@arcgis/core 4.34.0-next.40 → 4.34.0-next.42
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/016d421114118307d4dd.js +1 -0
- package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +1 -0
- package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +1 -0
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +1 -0
- package/assets/esri/core/workers/chunks/6b73926feb5c5d957062.js +1 -0
- package/assets/esri/core/workers/chunks/{6269c4bbf0f224a954e9.js → 6f4079b7a2b45f304ee6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e6e5677b90b00622146.js → 7ef7f3925495b9ade88c.js} +1 -1
- package/assets/esri/core/workers/chunks/82955562805ad5514ed8.js +346 -0
- package/assets/esri/core/workers/chunks/{5fe3c279d57f44416c28.js → a1d3f1c221389eb6090c.js} +1 -1
- package/assets/esri/core/workers/chunks/{306a68137e62656b0f05.js → d5d2d4df407cf078bb81.js} +1 -1
- package/assets/esri/core/workers/chunks/{94850c094e076d81a016.js → dca2b487152cde45fb65.js} +1 -1
- package/assets/esri/core/workers/chunks/{31ad9949b08a5b07218c.js → eea3e0bd17479a767160.js} +2 -2
- package/assets/esri/core/workers/chunks/fe6fa1f2c2d54d41645e.js +1 -0
- package/config.js +1 -1
- package/core/workers/registry.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/geometry/support/curves/closestPointOnCurve.js +1 -1
- package/geometry/support/curves/curveExtent.js +1 -1
- package/geometry/support/curves/curveLength.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/splitCurveAtPoint.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/interfaces.d.ts +24 -2
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/package.json +1 -1
- package/rest/networks/support/CircuitPath.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
- package/views/2d/engine/webgl/Mesh2D.js +1 -1
- package/views/2d/engine/webgl/VertexStream.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +5 -0
- package/views/3d/support/GaussianSplatWorkerHandle.js +5 -0
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/BackedBufferObject.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +5 -0
- package/views/PopupView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
- package/views/interactive/editGeometry/operations/ClosePart.js +5 -0
- package/views/interactive/editGeometry/operations/MoveMesh.js +1 -1
- package/views/interactive/editGeometry/operations/MoveVertex.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/operations/RemoveVertices.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/ScaleVertex.js +1 -1
- package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
- package/views/interactive/editGeometry/operations/SetVertexPosition.js +1 -1
- package/views/interactive/editGeometry/operations/SplitSegment.js +5 -0
- package/views/interactive/editGeometry/operations/UpdateVertices.js +1 -1
- package/views/interactive/editGeometry/operations/curveOperationUtils.js +5 -0
- package/views/interactive/editGeometry/operations.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/views/support/TileTreeDebugger.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/views/webgl/VertexBuffer.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMeshWorker.js +5 -0
- package/widgets/Spinner.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/01bd8f90e55081e65b38.js +0 -1
- package/assets/esri/core/workers/chunks/0a27f9b11d03874809ee.js +0 -346
- package/assets/esri/core/workers/chunks/34f677e8c1691c10e4e9.js +0 -1
- package/assets/esri/core/workers/chunks/e95a8c988ef822723503.js +0 -1
- package/assets/esri/core/workers/chunks/fd3009164d5e38fda85f.js +0 -1
- package/views/interactive/editGeometry/operations/CloseComponent.js +0 -5
- package/views/interactive/editGeometry/operations/SplitEdge.js +0 -5
|
@@ -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{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{q as n}from"../../../../../chunks/vec32.js";import{ZEROS as l,clone as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as T}from"../../../../../views/webgl/enums.js";const b=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,l)||(t.translation=c(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=c(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(T.FLOAT,"VEC3",34962);let g,x,b,_;l&&(g=r.addBufferView(T.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(T.FLOAT,"VEC2",34962)),c&&(b=r.addBufferView(T.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(T.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),b&&b.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),b&&null!=c&&(b.push(c[4*f]),b.push(c[4*f+1]),b.push(c[4*f+2]),b.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const O=d.endAccessor(),v=this._addAccessor(d.index,O);let R,N,C,S,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();N=this._addAccessor(x.index,e)}if(b){const e=b.endAccessor();C=this._addAccessor(b.index,e)}if(_){const e=_.endAccessor();S=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(T.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,v,R,N,C,S)):this._addMeshVertexNonIndexed(e.components,y,v,R,N,C,S),d.finalize(),g
|
|
5
|
+
import{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{q as n}from"../../../../../chunks/vec32.js";import{ZEROS as l,clone as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as T}from"../../../../../views/webgl/enums.js";const b=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,l)||(t.translation=c(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=c(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(T.FLOAT,"VEC3",34962);let g,x,b,_;l&&(g=r.addBufferView(T.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(T.FLOAT,"VEC2",34962)),c&&(b=r.addBufferView(T.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(T.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),b&&b.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),b&&null!=c&&(b.push(c[4*f]),b.push(c[4*f+1]),b.push(c[4*f+2]),b.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const O=d.endAccessor(),v=this._addAccessor(d.index,O);let R,N,C,S,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();N=this._addAccessor(x.index,e)}if(b){const e=b.endAccessor();C=this._addAccessor(b.index,e)}if(_){const e=_.endAccessor();S=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(T.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,v,R,N,C,S)):this._addMeshVertexNonIndexed(e.components,y,v,R,N,C,S),d.finalize(),g?.finalize(),x?.finalize(),b?.finalize(),I?.finalize(),_?.finalize(),s||r.finalize(),y}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const r=e=>{const t=e.toRgba();return t[0]=w(t[0]/255),t[1]=w(t[1]/255),t[2]=w(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=r(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof h){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=r(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,b().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:r(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,s(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const r=this.gltf.extras;switch(r.output.image){case 2:{const e=r.binChunkBuffer.addBufferView(T.UNSIGNED_BYTE,"SCALAR");if(x(t))null!=t.data&&e.writeOutToBuffer(t.data,0);else{const i=d(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));r.promises.push(e.writeAsync(i).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}s.uri=g(t);break;default:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}r.promises.push(d(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const r={wrapS:t,wrapT:s};for(let o=0;o<this.gltf.samplers.length;++o)if(JSON.stringify(r)===JSON.stringify(this.gltf.samplers[o]))return o;const i=this.gltf.samplers.length;return this.gltf.samplers.push(r),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const r=this.gltf.accessors.length;return this.gltf.accessors.push(s),r}_addMeshVertexIndexed(e,t,s,r,i,o,a,n){const l=new Map;for(const c of t){if(e.startAccessor("INDICES"),c.faces)for(let s=0;s<c.faces.length;++s)e.push(c.faces[s]);const t=e.endAccessor(),u={attributes:{POSITION:r},indices:this._addAccessor(e.index,t),material:this._addMaterial(c.material)};i&&"flat"!==c.shading&&(u.attributes.NORMAL=i),o&&(u.attributes.TEXCOORD_0=o),a&&"flat"!==c.shading&&(u.attributes.TANGENT=a),n&&(u.attributes.COLOR_0=n);const h=l.get(c.name);if(h)h.primitives.push(u);else{const e={name:c.name,primitives:[u]};l.set(c.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,r,i,o,a){const n={primitives:[]};t.push(n);const l={attributes:{POSITION:s}};r&&(l.attributes.NORMAL=r),i&&(l.attributes.TEXCOORD_0=i),o&&(l.attributes.TANGENT=o),a&&(l.attributes.COLOR_0=a),e&&(l.material=this._addMaterial(e[0].material)),n.primitives.push(l)}}function M({position:e,normal:t,tangent:s}){A(e,3),A(t,3),A(s,4)}function A(e,t){if(null!=e)for(let s=1,r=2;s<e.length;s+=t,r+=t){const t=e[s],i=e[r];e[s]=i,e[r]=-t}}function w(t){return t**e}export{_ as GLTF};
|
package/interfaces.d.ts
CHANGED
|
@@ -30300,7 +30300,7 @@ declare namespace __esri {
|
|
|
30300
30300
|
values?: number[];
|
|
30301
30301
|
}
|
|
30302
30302
|
|
|
30303
|
-
export interface PointCloudLayer extends Layer, SceneService, PortalLayer, ScaleRangeLayer, CustomParametersMixin, APIKeyMixin, OperationalLayer {
|
|
30303
|
+
export interface PointCloudLayer extends Layer, Clonable, SceneService, PortalLayer, ScaleRangeLayer, CustomParametersMixin, APIKeyMixin, OperationalLayer {
|
|
30304
30304
|
}
|
|
30305
30305
|
|
|
30306
30306
|
export class PointCloudLayer {
|
|
@@ -30455,6 +30455,12 @@ declare namespace __esri {
|
|
|
30455
30455
|
*/
|
|
30456
30456
|
get spatialReference(): SpatialReference;
|
|
30457
30457
|
set spatialReference(value: SpatialReferenceProperties);
|
|
30458
|
+
/**
|
|
30459
|
+
* Creates a deep clone of this object.
|
|
30460
|
+
*
|
|
30461
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#clone Read more...}
|
|
30462
|
+
*/
|
|
30463
|
+
clone(): this;
|
|
30458
30464
|
/**
|
|
30459
30465
|
* Creates a default popup template for the layer, populated with all the fields of the layer.
|
|
30460
30466
|
*
|
|
@@ -50253,6 +50259,14 @@ declare namespace __esri {
|
|
|
50253
50259
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-Network.html#getObjectIdsFromElements Read more...}
|
|
50254
50260
|
*/
|
|
50255
50261
|
getObjectIdsFromElements(elements: NetworkElement[]): LayerInfo[];
|
|
50262
|
+
/**
|
|
50263
|
+
* Returns the layer ID for a given network source ID.
|
|
50264
|
+
*
|
|
50265
|
+
* @param layerId The id of the layer.
|
|
50266
|
+
*
|
|
50267
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-Network.html#getSourceIdByLayerId Read more...}
|
|
50268
|
+
*/
|
|
50269
|
+
getSourceIdByLayerId(layerId: number): number | nullish;
|
|
50256
50270
|
/**
|
|
50257
50271
|
* `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected).
|
|
50258
50272
|
*
|
|
@@ -51080,6 +51094,14 @@ declare namespace __esri {
|
|
|
51080
51094
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-support-UNTraceConfiguration.html#includeUpToFirstSpatialContainer Read more...}
|
|
51081
51095
|
*/
|
|
51082
51096
|
includeUpToFirstSpatialContainer: boolean | nullish;
|
|
51097
|
+
/**
|
|
51098
|
+
* Specifies whether the path trace will use connectivity inference
|
|
51099
|
+
* to traverse containment associations to find a path between the
|
|
51100
|
+
* specified starting and stopping location.
|
|
51101
|
+
*
|
|
51102
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-support-UNTraceConfiguration.html#inferConnectivity Read more...}
|
|
51103
|
+
*/
|
|
51104
|
+
inferConnectivity: boolean | nullish;
|
|
51083
51105
|
/**
|
|
51084
51106
|
* Specifies the parameters needed for calculating nearest neighbors.
|
|
51085
51107
|
*
|
|
@@ -116589,7 +116611,7 @@ declare namespace __esri {
|
|
|
116589
116611
|
*
|
|
116590
116612
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#updateGeometry Read more...}
|
|
116591
116613
|
*/
|
|
116592
|
-
updateGeometry(): void
|
|
116614
|
+
updateGeometry(): Promise<void>;
|
|
116593
116615
|
}
|
|
116594
116616
|
|
|
116595
116617
|
interface FeatureViewModelProperties {
|
package/kernel.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 has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.42",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -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"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,invalidLayerView as h}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as u}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as y}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";let m=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then(()=>{this._worker?.destroy(),this._worker=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:d})}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=u().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,u=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,u,d,this._debugLevel)?(this._worker=new _(g(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const a of e){const e=new URL(a),n=e.searchParams.get("session");n?this._session=n:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then(e=>e.data))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},a={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},n=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,n);Promise.all(o).then(e=>(a.inputs=e,this._worker.invoke(a,i))).then(e=>e).catch(t=>(s(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:1,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]})).then(o=>{if(1===o.status)this._onJobFailed(t,o,e);else if(0===o.status)this._onJobSucceeded(t,o,e);else if(2===o.status){const l=this._getRequestPromises(o.missingInputUrls,r,n);Promise.all(l).then(e=>{a.jobDescJson=o.jobDescJson,o.originalInputs?a.inputs=o.originalInputs:a.inputs=[],a.isMissingResourceCase=!0;for(const t of e)a.inputs.push(t);return this._worker.invoke(a,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),s(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}})}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{s(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:h};const i=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON));if(0!==i.errorCode)return{wasmLayerId:h,check:i};const r=this._lyr3DMain.get_next_layer_id(),s=new AbortController;this._layers.set(r,{layerView:e,abortController:s,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const a=y(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,r,a)?(this._updateWasmCamera(),{wasmLayerId:r}):(this._layers.delete(r),{wasmLayerId:h})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([l("esri.layers.Lyr3DWasmPerSceneView")],m);const c=m;export{c as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,invalidLayerView as h}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as _}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as u}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as y}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as g}from"../views/3d/layers/support/makeScheduleFunction.js";let m=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera())]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:d})}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=u().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,u=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,u,d,this._debugLevel)?(this._workerHandle=new _(g(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach(i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory}),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach(e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())})}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const a of e){const e=new URL(a),n=e.searchParams.get("session");n?this._session=n:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then(e=>e.data))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},a={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},n=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,n);Promise.all(o).then(e=>(a.inputs=e,this._workerHandle.invoke(a,i))).then(e=>e).catch(t=>(s(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:1,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]})).then(o=>{if(1===o.status)this._onJobFailed(t,o,e);else if(0===o.status)this._onJobSucceeded(t,o,e);else if(2===o.status){const l=this._getRequestPromises(o.missingInputUrls,r,n);Promise.all(l).then(e=>{a.jobDescJson=o.jobDescJson,o.originalInputs?a.inputs=o.originalInputs:a.inputs=[],a.isMissingResourceCase=!0;for(const t of e)a.inputs.push(t);return this._workerHandle.invoke(a,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t),s(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}})}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)}).catch(t=>{s(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:h};const i=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON));if(0!==i.errorCode)return{wasmLayerId:h,check:i};const r=this._lyr3DMain.get_next_layer_id(),s=new AbortController;this._layers.set(r,{layerView:e,abortController:s,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const a=y(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,r,a)?(this._updateWasmCamera(),{wasmLayerId:r}):(this._layers.delete(r),{wasmLayerId:h})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([l("esri.layers.Lyr3DWasmPerSceneView")],m);const c=m;export{c 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 r from"../PopupTemplate.js";import t from"../request.js";import o from"../core/Error.js";import{clone as
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import t from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import i from"../core/Error.js";import{clone as s}from"../core/lang.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../core/object.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{join as d}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import y from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{CustomParametersMixin as v}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{SceneService as b}from"./mixins/SceneService.js";import{types as S}from"./pointCloudFilters/typeUtils.js";import{popupEnabled as x,elevationInfo as T,legendEnabled as P}from"./support/commonProperties.js";import F from"./support/Field.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import C from"../popup/ExpressionInfo.js";import{types as _}from"../renderers/support/pointCloud/typeUtils.js";import{logInvalidElevationInfoWarning as N,elevationModeRequiredMessage as E,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";import{createPopupTemplate as O}from"../support/popupUtils.js";const A=L();let U=class extends(b(g(j(w(I(a(v(h(o(y)))))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const r=this.fieldsIndex.get(e);return r?.domain?r.domain:null}readServiceFields(e,r,t){return Array.isArray(e)?e.map(e=>{const r=new F;return"FieldTypeInteger"===e.type&&((e=s(e)).type="esriFieldTypeInteger"),r.read(e,t),r}):Array.isArray(r.attributeStorageInfo)?r.attributeStorageInfo.map(e=>new F({name:e.name,type:"ELEVATION"===e.name?"double":"integer"})):null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}writeRenderer(e,r,t,o){p("layerDefinition.drawingInfo.renderer",e.write({},o),r)}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(l).then(()=>this._fetchService(r));return this.addResolvingPromise(t),Promise.resolve(this)}createPopupTemplate(e){const r=O(this,e);return r&&(this._formatPopupTemplateReturnsField(r),this._formatPopupTemplateRGBField(r)),r}_formatPopupTemplateReturnsField(e){const r=this.fieldsIndex.get("RETURNS");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new C({name:"pcl-returns-decoded",title:r.alias||r.name,expression:`\n var returnValue = $feature.${r.name};\n return (returnValue % 16) + " / " + Floor(returnValue / 16);\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const r=this.fieldsIndex.get("RGB");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new C({name:"pcl-rgb-decoded",title:r.alias||r.name,expression:`\n var rgb = $feature.${r.name};\n var red = Floor(rgb / 65536, 0);\n var green = Floor((rgb - (red * 65536)) / 256,0);\n var blue = rgb - (red * 65536) - (green * 256);\n\n return "rgb(" + red + "," + green + "," + blue + ")";\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,r){if(await this.load(r),!this.attributeStorageInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const o=this.fieldsIndex.get(e);if(!o)throw new i("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.attributeStorageInfo)if(i.name===o.name){const e=d(this.parsedUrl?.path??"",`./statistics/${i.key}`);return t(e,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r?r.signal:null}).then(e=>e.data)}throw new i("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,r){return this._debouncedSaveOperations(1,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"PointCloud"!==e.layerType)throw new i("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some(r=>r.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(e){N(n.getLogger(this),E("Point cloud layers","absolute-height",e)),N(n.getLogger(this),R("Point cloud layers",e))}};e([u({type:["PointCloudLayer"]})],U.prototype,"operationalLayerType",void 0),e([u(x)],U.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],U.prototype,"popupTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],U.prototype,"defaultPopupTemplate",null),e([u({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],U.prototype,"opacity",void 0),e([u({type:["show","hide"]})],U.prototype,"listMode",void 0),e([u({types:[S],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],U.prototype,"filters",void 0),e([u({type:[F]})],U.prototype,"fields",void 0),e([u(A.fieldsIndex)],U.prototype,"fieldsIndex",void 0),e([m("service","fields",["fields","attributeStorageInfo"])],U.prototype,"readServiceFields",null),e([u(A.outFields)],U.prototype,"outFields",void 0),e([u({readOnly:!0})],U.prototype,"attributeStorageInfo",void 0),e([u(T)],U.prototype,"elevationInfo",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],U.prototype,"path",void 0),e([u(P)],U.prototype,"legendEnabled",void 0),e([u({types:_,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:_},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],U.prototype,"renderer",void 0),e([f("renderer")],U.prototype,"writeRenderer",null),e([u({json:{read:!1},readOnly:!0})],U.prototype,"type",void 0),U=e([c("esri.layers.PointCloudLayer")],U);const V=U;export{V as default};
|
package/package.json
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{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polyline.js";import p from"./CircuitPathConnectivityElement.js";import s from"./TraceLocation.js";let n=class extends o{constructor(t){super(t),this.pathId=null,this.
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polyline.js";import p from"./CircuitPathConnectivityElement.js";import s from"./TraceLocation.js";let n=class extends o{constructor(t){super(t),this.pathId=null,this.order=null,this.startingPoint=null,this.stoppingPoint=null,this.pathConnectivity=[],this.geometry=null}};t([r({type:Number,json:{write:!0}})],n.prototype,"pathId",void 0),t([r({type:Number,json:{write:!0}})],n.prototype,"order",void 0),t([r({type:s,json:{write:!0}})],n.prototype,"startingPoint",void 0),t([r({type:s,json:{write:!0}})],n.prototype,"stoppingPoint",void 0),t([r({type:[p],json:{write:!0}})],n.prototype,"pathConnectivity",void 0),t([r({type:i,json:{write:!0}})],n.prototype,"geometry",void 0),n=t([e("esri.rest.networks.support.CircuitPath")],n);const c=n;export{c 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{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../../geometry/Point.js";import{estimateStatisticsFromHistograms as a}from"../../../../layers/support/rasterFunctions/stretchUtils.js";import o from"../../../../rest/support/ImageHistogramParameters.js";import i from"./RasterLayerAdapter.js";let n=class extends i{generateRasterInfo(t){const e=t?.rasterFunction;try{return this.layer.generateRasterInfo(e,{signal:t?.signal})}catch{return Promise.resolve(this.layer.serviceRasterInfo)}}async estimateStatisticsHistograms(t){const{layer:e}=this,s=e.mosaicRule?.multidimensionalDefinition?.[0]?.variableName??"",i=`${t?.rasterFunction?.functionName??"default"}${s}`,n=this._statsCache.get(i);if(n)return n;let{width:c,height:m,pixelSize:l}=e.rasterInfo,p=1;for(;c>2e3||m>2e3;)c/=2,m/=2,p*=2;const u=t?.rasterFunction??e.rasterFunction,{fullExtent:g,mosaicRule:h}=e;l=new r(l.x*p,l.y*p,g.spatialReference);const f=new o({geometry:g,pixelSize:l,renderingRule:u,mosaicRule:h});let d;if(e.capabilities.operations.supportsComputeStatisticsHistograms)d=await e.computeStatisticsHistograms(f,t);else{const{histograms:s}=await e.computeHistograms(f,t);d={statistics:a(s),histograms:s}}return d&&this._statsCache.put(i,d),d}supportsMultidirectionalHillshade(){return this.layer.version>=10.81}load(t){return this.addResolvingPromise(this.layer.load(t).then(async()=>{const e=t?.signal;this.rasterInfo=await this.generateRasterInfo({rasterFunction:this.rasterFunction,signal:e})})),Promise.resolve(this)}};t([e()],n.prototype,"layer",void 0),n=t([s("esri.smartMapping.raster.support.adapters.ImageryLayerAdapter")],n);const c=n;export{c as default};
|
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 e="20250717",a="994578f4d289ea91142aeed1ec2eb9673356a400";export{e as buildDate,a 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{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as r,setUniforms as a}from"../utils.js";import{
|
|
5
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as r,setUniforms as a}from"../utils.js";import{PrimitiveType as e,DataType as s}from"../../../../webgl/enums.js";import{Texture as o}from"../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as n}from"../../../../webgl/VertexArrayObject.js";import{fromLayout as m}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as l}from"../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../../webgl/VertexElementDescriptor.js";class c{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof c))return!1;if(!r(this._params.timeExtent,t._params.timeExtent))return!1;let a=!0;return a=a&&this._params.loadImagery===t._params.loadImagery,a=a&&this._params.color.kind===t._params.color.kind,a=a&&this._params.opacity.kind===t._params.opacity.kind,a}async load(r,a){const{extent:e,size:s}=r;t(a);const o=await this._params.loadImagery(e,s[0],s[1],this._params.timeExtent,a);return new _(o,{color:this._params.color,opacity:this._params.opacity})}render(t,r,s){const{context:o}=t,{program:i}=s;o.setFaceCullingEnabled(!1),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.useProgram(i),i.setUniformMatrix3fv("u_dvsMat3",r.dvsMat3),o.bindTexture(s.texture,0),i.setUniform1i("u_texture",0),i.setUniform1f("u_Min",s.min),i.setUniform1f("u_Max",s.max),a(i,"color","vec4",this._params.color),a(i,"opacity","float",this._params.opacity),o.bindVAO(s.vertexArray),o.drawArrays(e.TRIANGLE_STRIP,0,4)}}const h=[new p("a_position",2,s.UNSIGNED_SHORT,0,8),new p("a_texcoord",2,s.UNSIGNED_SHORT,4,8)],f={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",locations:m(h)};class _{constructor(t,r){this._flowData=t,this._values=r}attach(t){const{context:r}=t,{width:a,height:e}=this._flowData,s=new l(r,h,new Uint16Array([0,0,0,1,a,0,1,1,0,e,0,0,a,e,1,0])),m=new n(r,s),p=[];"ramp"===this._values.color.kind&&p.push("vvColor"),"ramp"===this._values.opacity.kind&&p.push("vvOpacity");const c=t.getProgram(f,p);let _=1e6,d=-1e6;for(let o=0;o<e;o++)for(let t=0;t<a;t++)if(0!==this._flowData.mask[o*a+t]){const r=this._flowData.data[2*(o*a+t)],e=this._flowData.data[2*(o*a+t)+1],s=Math.sqrt(r*r+e*e);_=Math.min(_,s),d=Math.max(d,s)}const u=new Uint8Array(4*a*e);for(let o=0;o<e;o++)for(let t=0;t<a;t++)if(0!==this._flowData.mask[o*a+t]){const r=this._flowData.data[2*(o*a+t)],e=this._flowData.data[2*(o*a+t)+1],s=(Math.sqrt(r*r+e*e)-_)/(d-_);u[4*(o*a+t)]=255*s,u[4*(o*a+t)+1]=0,u[4*(o*a+t)+2]=0,u[4*(o*a+t)+3]=255}else u[4*(o*a+t)]=0,u[4*(o*a+t)+1]=0,u[4*(o*a+t)+2]=0,u[4*(o*a+t)+3]=0;const w=new i(a,e);w.internalFormat=6408,w.wrapMode=33071,w.flipped=!0;const x=new o(r,w,u);this.vertexArray=m,this.program=c,this.texture=x,this.min=_,this.max=d,this._flowData=null}detach(){this.vertexArray.dispose(),this.texture.dispose()}get ready(){return this.program.compiled}}export{c as Imagery,_ as ImageryResources};
|
|
@@ -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{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{areStreamlinesCompatible as e,setUniforms as a}from"../utils.js";import{BufferObject as r}from"../../../../webgl/BufferObject.js";import{PrimitiveType as s,DataType as i}from"../../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../../webgl/VertexArrayObject.js";import{fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../../webgl/VertexElementDescriptor.js";class l{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof l&&e(this._params,t._params)}async load(e,a){const{extent:r,size:s}=e;t(a);const i=await this._params.loadImagery(r,s[0],s[1],this._params.timeExtent,a),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,i,a);return new c(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,r){const{context:o}=t,{program:n}=r;o.setFaceCullingEnabled(!1),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.useProgram(n),n.setUniform1f("u_time",e.time),n.setUniform1f("u_trailLength",this._params.trailLength),n.setUniform1f("u_flowSpeed",this._params.flowSpeed),n.setUniform1f("u_featheringSize",this._params.featheringSize),n.setUniform1f("u_featheringOffset",this._params.featheringOffset),n.setUniform1f("u_introFade",this._params.introFade?1:0),n.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),n.setUniform1f("u_decayRate",this._params.decayRate),n.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),n.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),a(n,"color","vec4",this._params.color),a(n,"opacity","float",this._params.opacity),a(n,"size","float",this._params.size),o.bindVAO(r.vertexArray),o.drawElements(s.TRIANGLES,r.indexCount,i.UNSIGNED_INT,0)}}const f=[new p("a_xyts0",4,i.FLOAT,0,64),new p("a_xyts1",4,i.FLOAT,16,64),new p("a_typeIdDurationSeed",4,i.FLOAT,32,64),new p("a_extrudeInfo",4,i.FLOAT,48,64)],h={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",locations:n(f)};class c{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=
|
|
5
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{areStreamlinesCompatible as e,setUniforms as a}from"../utils.js";import{BufferObject as r}from"../../../../webgl/BufferObject.js";import{PrimitiveType as s,DataType as i}from"../../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../../webgl/VertexArrayObject.js";import{fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../../webgl/VertexElementDescriptor.js";class l{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof l&&e(this._params,t._params)}async load(e,a){const{extent:r,size:s}=e;t(a);const i=await this._params.loadImagery(r,s[0],s[1],this._params.timeExtent,a),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,i,a);return new c(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,r){const{context:o}=t,{program:n}=r;o.setFaceCullingEnabled(!1),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.useProgram(n),n.setUniform1f("u_time",e.time),n.setUniform1f("u_trailLength",this._params.trailLength),n.setUniform1f("u_flowSpeed",this._params.flowSpeed),n.setUniform1f("u_featheringSize",this._params.featheringSize),n.setUniform1f("u_featheringOffset",this._params.featheringOffset),n.setUniform1f("u_introFade",this._params.introFade?1:0),n.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),n.setUniform1f("u_decayRate",this._params.decayRate),n.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),n.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),a(n,"color","vec4",this._params.color),a(n,"opacity","float",this._params.opacity),a(n,"size","float",this._params.size),o.bindVAO(r.vertexArray),o.drawElements(s.TRIANGLES,r.indexCount,i.UNSIGNED_INT,0)}}const f=[new p("a_xyts0",4,i.FLOAT,0,64),new p("a_xyts1",4,i.FLOAT,16,64),new p("a_typeIdDurationSeed",4,i.FLOAT,32,64),new p("a_extrudeInfo",4,i.FLOAT,48,64)],h={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",locations:n(f)};class c{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=new m(e,f,this._vertexData),s=r.createIndex(e,35044,this._indexData),i=new o(e,a,s),n=[];"ramp"===this._values.color.kind&&n.push("vvColor"),"ramp"===this._values.opacity.kind&&n.push("vvOpacity"),"ramp"===this._values.size.kind&&n.push("vvSize");const p=t.getProgram(h,n);this.vertexArray=i,this.program=p,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}}export{l as Particles,c as ParticlesResources};
|
|
@@ -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{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{areStreamlinesCompatible as e,setUniforms as a}from"../utils.js";import{BufferObject as s}from"../../../../webgl/BufferObject.js";import{PrimitiveType as r,DataType as i}from"../../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../../webgl/VertexArrayObject.js";import{fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../../webgl/VertexElementDescriptor.js";class l{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof l&&e(this._params,t._params)}async load(e,a){const{extent:s,size:r}=e;t(a);const i=await this._params.loadImagery(s,r[0],r[1],this._params.timeExtent,a),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,i,a);return new _(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:o}=t,{program:n}=s;o.setFaceCullingEnabled(!1),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.useProgram(n),n.setUniform1f("u_time",e.time),n.setUniform1f("u_trailLength",this._params.trailLength),n.setUniform1f("u_flowSpeed",this._params.flowSpeed),n.setUniform1f("u_featheringSize",this._params.featheringSize),n.setUniform1f("u_featheringOffset",this._params.featheringOffset),n.setUniform1f("u_introFade",this._params.introFade?1:0),n.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),n.setUniform1f("u_decayRate",this._params.decayRate),n.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),n.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),a(n,"color","vec4",this._params.color),a(n,"opacity","float",this._params.opacity),a(n,"size","float",this._params.size),o.bindVAO(s.vertexArray),o.drawElements(r.TRIANGLES,s.indexCount,i.UNSIGNED_INT,0)}}const f=[new p("a_positionAndSide",3,i.FLOAT,0,36),new p("a_timeInfo",3,i.FLOAT,12,36),new p("a_extrude",2,i.FLOAT,24,36),new p("a_speed",1,i.FLOAT,32,36)],h={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",locations:n(f)};class _{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=
|
|
5
|
+
import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{areStreamlinesCompatible as e,setUniforms as a}from"../utils.js";import{BufferObject as s}from"../../../../webgl/BufferObject.js";import{PrimitiveType as r,DataType as i}from"../../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../../webgl/VertexArrayObject.js";import{fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../../webgl/VertexElementDescriptor.js";class l{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof l&&e(this._params,t._params)}async load(e,a){const{extent:s,size:r}=e;t(a);const i=await this._params.loadImagery(s,r[0],r[1],this._params.timeExtent,a),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,i,a);return new _(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:o}=t,{program:n}=s;o.setFaceCullingEnabled(!1),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.useProgram(n),n.setUniform1f("u_time",e.time),n.setUniform1f("u_trailLength",this._params.trailLength),n.setUniform1f("u_flowSpeed",this._params.flowSpeed),n.setUniform1f("u_featheringSize",this._params.featheringSize),n.setUniform1f("u_featheringOffset",this._params.featheringOffset),n.setUniform1f("u_introFade",this._params.introFade?1:0),n.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),n.setUniform1f("u_decayRate",this._params.decayRate),n.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),n.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),a(n,"color","vec4",this._params.color),a(n,"opacity","float",this._params.opacity),a(n,"size","float",this._params.size),o.bindVAO(s.vertexArray),o.drawElements(r.TRIANGLES,s.indexCount,i.UNSIGNED_INT,0)}}const f=[new p("a_positionAndSide",3,i.FLOAT,0,36),new p("a_timeInfo",3,i.FLOAT,12,36),new p("a_extrude",2,i.FLOAT,24,36),new p("a_speed",1,i.FLOAT,32,36)],h={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",locations:n(f)};class _{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=new m(e,f,this._vertexData),r=s.createIndex(e,35044,this._indexData),i=new o(e,a,r),n=[];"ramp"===this._values.color.kind&&n.push("vvColor"),"ramp"===this._values.opacity.kind&&n.push("vvOpacity"),"ramp"===this._values.size.kind&&n.push("vvSize");const p=t.getProgram(h,n);this.vertexArray=i,this.program=p,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}}export{l 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"../../../../core/has.js";import{identity as t,translate as e,rotate as a,scaleByVec2 as s,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{DataType as u}from"../../../webgl/enums.js";import{VertexArrayObject as d}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as f}from"../../../webgl/VertexBuffer.js";class v extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){super.destroy(),null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:a}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:a}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e),s=n(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:a,scalar:i}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:r()}}setTransform(r){const l=t(this.transforms.displayViewScreenMat3),[n,c]=r.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/r.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),a(l,l,-d),e(l,l,o(-m/2,-u/2)),s(l,l,o(m,u)),i(this.transforms.displayViewScreenMat3,r.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:s}=e,i=m.
|
|
5
|
+
import"../../../../core/has.js";import{identity as t,translate as e,rotate as a,scaleByVec2 as s,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{createVFMesh as l,createVFMeshScalar as n}from"../../../../layers/support/rasterFunctions/vectorFieldUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createProgramDescriptor as h}from"../webgl/Utils.js";import{BufferObject as m}from"../../../webgl/BufferObject.js";import{DataType as u}from"../../../webgl/enums.js";import{VertexArrayObject as d}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as f}from"../../../webgl/VertexBuffer.js";class v extends c{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){super.destroy(),null!=this.vaoData&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||null==this.vaoData||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,null!=this.source&&null==this.vaoData){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={magdir:a}}break;case"simple_scalar":{const e=n(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e);this.vaoData={scalar:a}}break;case"wind_speed":{const e=l(this.source,this.symbolizerParameters),a=this._createVectorFieldVAO(t.context,e),s=n(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:a,scalar:i}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:r()}}setTransform(r){const l=t(this.transforms.displayViewScreenMat3),[n,c]=r.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/r.resolution,m=h*this.width,u=h*this.height,d=Math.PI*this.rotation/180;e(l,l,o(n,c)),e(l,l,o(m/2,u/2)),a(l,l,-d),e(l,l,o(-m/2,-u/2)),s(l,l,o(m,u)),i(this.transforms.displayViewScreenMat3,r.displayViewMat3,l)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:s}=e,i=m.createIndex(t,35044,new Uint32Array(s)),r=h("vector-field",[{location:0,name:"a_pos",count:2,type:u.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:u.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:u.FLOAT,normalized:!1}]),o=new f(t,r.bufferLayout,new Float32Array(a));return{vao:new d(t,o,i),elementCount:s.length}}}export{v as RasterVFDisplayObject};
|
|
@@ -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{disposeMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import"../../tiling/TileInfoView.js";import r from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{deserializeSymbols as n}from"./decluttering/util.js";import{BufferObject as i}from"../../../webgl/BufferObject.js";import{VertexArrayObject as s}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as a}from"../../../webgl/VertexBuffer.js";class o{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._data=t;let r=1;const n=new Uint32Array(t);this.layerUIDs=[];const i=n[r++];for(let s=0;s<i;s++)this.layerUIDs[s]=n[r++];this.bufferDataOffset=r,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,this.isDestroyed=!0)}prepareForRendering(t){null!=this._data&&(this.doPrepareForRendering(t,this._data,this.bufferDataOffset),this._data=null)}}class h extends o{constructor(t,e){super(t,e),this.type=2,this.lineIndexStart=0,this.lineIndexCount=0;const r=new Uint32Array(t);let n=this.bufferDataOffset;this.lineIndexStart=r[n++],this.lineIndexCount=r[n++];const i=r[n++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=r[n++],e=r[n++],i=r[n++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=n}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.cachedMemory??0)}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),o=new Int32Array(n.buffer),h=n[r++],
|
|
5
|
+
import{disposeMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import"../../tiling/TileInfoView.js";import r from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{deserializeSymbols as n}from"./decluttering/util.js";import{BufferObject as i}from"../../../webgl/BufferObject.js";import{VertexArrayObject as s}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as a}from"../../../webgl/VertexBuffer.js";class o{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._data=t;let r=1;const n=new Uint32Array(t);this.layerUIDs=[];const i=n[r++];for(let s=0;s<i;s++)this.layerUIDs[s]=n[r++];this.bufferDataOffset=r,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,this.isDestroyed=!0)}prepareForRendering(t){null!=this._data&&(this.doPrepareForRendering(t,this._data,this.bufferDataOffset),this._data=null)}}class h extends o{constructor(t,e){super(t,e),this.type=2,this.lineIndexStart=0,this.lineIndexCount=0;const r=new Uint32Array(t);let n=this.bufferDataOffset;this.lineIndexStart=r[n++],this.lineIndexCount=r[n++];const i=r[n++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=r[n++],e=r[n++],i=r[n++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=n}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.cachedMemory??0)}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),o=new Int32Array(n.buffer),h=n[r++],l=this.layer.lineMaterial,f=new a(t,l.geometryLayout,new Int32Array(o.buffer,4*r,h));r+=h;const c=n[r++],y=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,c));r+=c,this.vao=new s(t,f,y)}}class l extends o{constructor(t,e){super(t,e),this.type=1,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(t);let n=this.bufferDataOffset;this.fillIndexStart=r[n++],this.fillIndexCount=r[n++],this.outlineIndexStart=r[n++],this.outlineIndexCount=r[n++];const i=r[n++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=r[n++],e=r[n++],i=r[n++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=n}get usedMemory(){return(this.data?.byteLength??0)+(this.fillVAO?.cachedMemory??0)+(this.outlineVAO?.cachedMemory??0)}hasData(){return this.fillIndexCount>0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=t(this.fillVAO),this.outlineVAO=t(this.outlineVAO)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),o=new Int32Array(n.buffer),h=n[r++],l=this.layer,f=l.fillMaterial,c=new a(t,f.geometryLayout,new Int32Array(o.buffer,4*r,h));r+=h;const y=n[r++],u=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,y));r+=y;const d=n[r++],p=l.outlineMaterial,g=new a(t,p.geometryLayout,new Int32Array(o.buffer,4*r,d));r+=d;const w=n[r++],I=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,w));r+=w,this.fillVAO=new s(t,c,u),this.outlineVAO=new s(t,g,I)}}class f extends o{constructor(t,e,i){super(t,e),this.type=3,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(t),a=new Int32Array(t),o=new Float32Array(t);let h=this.bufferDataOffset;this.isIconSDF=!!s[h++];const l=s[h++],f=s[h++],c=s[h++],y=new r(l,f,c,0),u=s[h++];for(let r=0;r<u;r++){const t=s[h++],e=s[h++],r=s[h++];this.iconPerPageElementsMap.set(t,[e,r])}const d=s[h++];for(let r=0;r<d;r++){const t=s[h++],e=s[h++],r=s[h++];this.glyphPerPageElementsMap.set(t,[e,r])}const p=s[h++],g=s[h++];this.iconOpacity=new Int32Array(p),this.textOpacity=new Int32Array(g),h=n(s,a,o,h,this.symbols,i,y),this.bufferDataOffset=h}get usedMemory(){return(this.data?.byteLength??0)+(this.iconVAO?.cachedMemory??0)+(this.textVAO?.cachedMemory??0)+e(this.iconOpacity)+e(this.textOpacity)}hasData(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}triangleCount(){let t=0;for(const e of this.iconPerPageElementsMap.values())t+=e[1];for(const e of this.glyphPerPageElementsMap.values())t+=e[1];return t/3}doDestroy(){this.iconVAO=t(this.iconVAO),this.textVAO=t(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const t=this.iconOpacity,e=this.iconVAO.buffer("opacity");t.length>0&&t.byteLength===e.usedMemory&&e.setSubData(t,0,0,t.length);const r=this.textOpacity,n=this.textVAO.buffer("opacity");r.length>0&&r.byteLength===n.usedMemory&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),o=new Int32Array(n.buffer),h=n[r++],l=this.layer,f=l.iconMaterial,c=new a(t,f.geometryLayout,new Int32Array(o.buffer,4*r,h));r+=h;const y=n[r++],u=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,y));r+=y;const d=n[r++],p=l.textMaterial,g=new a(t,p.geometryLayout,new Int32Array(o.buffer,4*r,d));r+=d;const w=n[r++],I=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,w));r+=w;const m=new a(t,f.opacityLayout,this.iconOpacity.buffer),b=new a(t,p.opacityLayout,this.textOpacity.buffer);this.iconVAO=new s(t,new Map([["geometry",c],["opacity",m]]),u),this.textVAO=new s(t,new Map([["geometry",g],["opacity",b]]),I)}}class c extends o{constructor(t,e){super(t,e),this.type=4,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(t);let n=this.bufferDataOffset;this.circleIndexStart=r[n++],this.circleIndexCount=r[n++],this.bufferDataOffset=n}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.cachedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),o=new Int32Array(n.buffer),h=n[r++],l=this.layer.circleMaterial,f=new a(t,l.geometryLayout,new Int32Array(o.buffer,4*r,h));r+=h;const c=n[r++],y=i.createIndex(t,35044,new Uint32Array(n.buffer,4*r,c));r+=c,this.vao=new s(t,f,y)}}export{c as CircleRenderBucket,l as FillRenderBucket,h as LineRenderBucket,o as RenderBucketBase,f as SymbolRenderBucket};
|
|
@@ -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{disposeMaybe as r}from"../../../../core/maybe.js";import{bitBlit as t}from"./shaders/BitBlitPrograms.js";import{
|
|
5
|
+
import{disposeMaybe as r}from"../../../../core/maybe.js";import{bitBlit as t}from"./shaders/BitBlitPrograms.js";import{PrimitiveType as e}from"../../../webgl/enums.js";import{createProgram as i}from"../../../webgl/ProgramTemplate.js";import{VertexArrayObject as s}from"../../../webgl/VertexArrayObject.js";import{PosTex2b as o}from"../../../webgl/VertexAttributeLayouts.js";import{VertexBuffer as a}from"../../../webgl/VertexBuffer.js";class n{constructor(){this._initialized=!1}dispose(){this._program=r(this._program),this._vertexArrayObject=r(this._vertexArrayObject)}render(r,t,i,s){r&&(this._initialized||this._initialize(r),r.setBlendFunctionSeparate(1,771,1,771),r.bindVAO(this._vertexArrayObject),r.useProgram(this._program),t.setSamplingMode(i),r.bindTexture(t,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),r.drawArrays(e.TRIANGLE_STRIP,0,4),r.bindTexture(null,0),r.bindVAO(null))}_initialize(r){if(this._initialized)return!0;const e=new Int8Array(16);e[0]=-1,e[1]=-1,e[2]=0,e[3]=0,e[4]=1,e[5]=-1,e[6]=1,e[7]=0,e[8]=-1,e[9]=1,e[10]=0,e[11]=1,e[12]=1,e[13]=1,e[14]=1,e[15]=1;const n=new s(r,new a(r,o,e));return this._program=i(r,t,n.locations),this._vertexArrayObject=n,this._initialized=!0,!0}}export{n as BitBlitRenderer};
|
|
@@ -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"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertFromNestedArray as s,convertFromPolygon as i}from"../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{i1616to32 as
|
|
5
|
+
import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertFromNestedArray as s,convertFromPolygon as i}from"../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{i1616to32 as a}from"./number.js";import{BufferObject as f}from"../../../webgl/BufferObject.js";import{PrimitiveType as m}from"../../../webgl/enums.js";import{VertexBuffer as h}from"../../../webgl/VertexBuffer.js";const l=(e,r,t,o)=>{let n=0;for(let s=1;s<t;s++){const t=e[2*(r+s-1)],o=e[2*(r+s-1)+1];n+=(e[2*(r+s)]-t)*(e[2*(r+s)+1]+o)}return o?n>0:n<0},u=({coords:e,lengths:r},o)=>{const n=[];for(let s=0,i=0;s<r.length;i+=r[s],s+=1){const c=i,a=[];for(;s<r.length-1&&l(e,i+r[s],r[s+1],o);s+=1,i+=r[s])a.push(i+r[s]-c);const f=e.slice(2*c,2*(i+r[s])),m=t(f,a,2);for(const e of m)n.push(e+c)}return n};class x{constructor(e,r,t,o=!1){this.vertices=e,this.indices=r,this.primitiveType=t,this.isMapSpace=o,this._cache={}}static fromPath(e){const r=s(new c,e.path,!1,!1),t=r.coords,o=new Uint32Array(u(r,!0)),n=new Uint32Array(t.length/2);for(let s=0;s<n.length;s++)n[s]=a(Math.floor(t[2*s]),Math.floor(t[2*s+1]));return new x(n,o,m.TRIANGLES)}static fromGeometry(t,o){const n=o.geometry?.type;switch(n){case"polygon":return x.fromPolygon(t,o.geometry);case"extent":return x.fromMapExtent(t,o.geometry);default:return r.getLogger("esri.views.2d.engine.webgl.Mesh2D").error(new e("mapview-bad-type",`Unable to create a mesh from type ${n}`,o)),x.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}static fromPolygon(e,r){const t=i(new c,r,!1,!1),s=t.coords,f=new Uint32Array(u(t,!1)),h=new Uint32Array(s.length/2),l=n(),p=n();for(let n=0;n<h.length;n++)o(l,s[2*n],s[2*n+1]),e.toScreen(p,l),h[n]=a(Math.floor(p[0]),Math.floor(p[1]));return new x(h,f,m.TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:r,ymin:t,ymax:o}){const n=new Uint32Array([a(e,t),a(r,t),a(e,o),a(e,o),a(r,t),a(r,o)]),s=new Uint32Array([0,1,2,3,4,5]);return new x(n,s,m.TRIANGLES)}static fromMapExtent(e,r){const[t,o]=e.toScreen([0,0],[r.xmin,r.ymin]),[n,s]=e.toScreen([0,0],[r.xmax,r.ymax]),i=new Uint32Array([a(t,o),a(n,o),a(t,s),a(t,s),a(n,o),a(n,s)]),c=new Uint32Array([0,1,2,3,4,5]);return new x(i,c,m.TRIANGLES)}destroy(){null!=this._cache.indexBuffer&&this._cache.indexBuffer.dispose(),this._cache.vertexBuffer?.dispose(),this._cache.indexBuffer=this._cache.vertexBuffer=null}getIndexBuffer(e,r=35044){return this._cache.indexBuffer??=f.createIndex(e,r,this.indices),this._cache.indexBuffer}getVertexBuffers(e,r){return this._cache.vertexBuffer??=new h(e,r,this.vertices),this._cache.vertexBuffer}}export{x 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{vertexLayoutHash as t}from"./shaderGraph/techniques/mesh/utils.js";import{
|
|
5
|
+
import{vertexLayoutHash as t}from"./shaderGraph/techniques/mesh/utils.js";import{DataType as s,PrimitiveType as e}from"../../../webgl/enums.js";import{VertexArrayObject as r}from"../../../webgl/VertexArrayObject.js";import{VertexBuffer as i}from"../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as o}from"../../../webgl/VertexElementDescriptor.js";class a{constructor(e,a){this._rctx=e,this._attributes=[{name:"position",offset:0,type:s.SHORT,count:2}],this.layout={hash:t(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=new i(e,[new o("a_position",2,s.SHORT,0,4)],new Uint16Array(a)),this._vao=new r(e,this._vertexBuffer),this._count=a.length/2}get locations(){return this._vao.locations}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.TRIANGLE_STRIP,0,this._count)}}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{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import r from"./WGLBrush.js";import{background as t}from"../shaders/BackgroundPrograms.js";import{
|
|
5
|
+
import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import r from"./WGLBrush.js";import{background as t}from"../shaders/BackgroundPrograms.js";import{PrimitiveType as i}from"../../../../webgl/enums.js";import{createProgram as s}from"../../../../webgl/ProgramTemplate.js";import{VertexArrayObject as o}from"../../../../webgl/VertexArrayObject.js";import{Pos2b as a}from"../../../../webgl/VertexAttributeLayouts.js";import{VertexBuffer as l}from"../../../../webgl/VertexBuffer.js";class n extends r{constructor(){super(...arguments),this._color=e(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:e}){e.setDepthWriteEnabled(!1),e.setDepthTestEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(7680,7680,7681),e.setStencilWriteMask(255)}draw(e,r){const{context:t,requestRender:s,allowDelayedRender:o}=e;this._initialized||this._initialize(t),!o||null==s||this._solidProgram.compiled?(t.setStencilFunctionSeparate(1032,516,r.stencilRef,255),t.bindVAO(this._solidVertexArrayObject),t.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[r.rangeX,r.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),t.drawArrays(i.TRIANGLE_STRIP,0,4),t.bindVAO(null)):s()}_initialize(e){if(this._initialized)return!0;const r=new Int8Array([0,0,1,0,0,1,1,1]),i=new l(e,a,r),n=new o(e,i);return this._solidProgram=s(e,t,n.locations),this._solidVertexArrayObject=n,this._initialized=!0,!0}}export{n 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{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{FeatureTile as t}from"../FeatureTile.js";import r from"./WGLBrush.js";import{background as o}from"../shaders/BackgroundPrograms.js";import{tileInfo as i}from"../shaders/TileInfoPrograms.js";import{
|
|
5
|
+
import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{FeatureTile as t}from"../FeatureTile.js";import r from"./WGLBrush.js";import{background as o}from"../shaders/BackgroundPrograms.js";import{tileInfo as i}from"../shaders/TileInfoPrograms.js";import{PrimitiveType as s}from"../../../../webgl/enums.js";import{createProgram as n}from"../../../../webgl/ProgramTemplate.js";import{Texture as l}from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as f}from"../../../../webgl/VertexArrayObject.js";import{Pos2b as m}from"../../../../webgl/VertexAttributeLayouts.js";import{VertexBuffer as c}from"../../../../webgl/VertexBuffer.js";const u=512,d=512,h=16,g=8,_=(d-2*g)/5;class x extends r{constructor(){super(...arguments),this._color=e(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(1,771,1,771),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1)}draw(e,r){const{context:o,requestRender:i,allowDelayedRender:n}=e;if(!r.isReady&&r instanceof t&&r.hasData)return;if(this._loadWGLResources(o),n&&null!=i&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void i();o.bindVAO(this._outlineVertexArrayObject),o.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",r.rangeX,r.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),o.drawArrays(s.LINE_STRIP,0,4);const l=this._getTexture(o,r);l?(o.bindVAO(this._tileInfoVertexArrayObject),o.useProgram(this._tileInfoProgram),o.bindTexture(l,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",r.rangeX/r.width,r.rangeY/r.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",l.descriptor.width,l.descriptor.height),o.drawArrays(s.TRIANGLE_STRIP,0,4),o.bindVAO(null)):o.bindVAO(null)}_loadWGLResources(e){if(this._outlineProgram&&this._tileInfoProgram)return;const t=new Int8Array([0,0,1,0,1,1,0,1]),r=new c(e,m,t);this._outlineVertexArrayObject=new f(e,r),this._outlineProgram=n(e,o,this._outlineVertexArrayObject.locations);const s=new Int8Array([0,0,1,0,0,1,1,1]),l=new c(e,m,s);this._tileInfoVertexArrayObject=new f(e,l),this._tileInfoProgram=n(e,i,this._tileInfoVertexArrayObject.locations)}_getTexture(e,t){if(!this._ctx){const e=document.createElement("canvas");e.width=u,e.height=d,this._ctx=e.getContext("2d")}if(!t.tileDebugInfoTexture){const r=new a(u,d);r.wrapMode=33071,r.samplingMode=9729,r.isImmutable=!0,t.tileDebugInfoTexture=new l(e,r)}const r=this._ctx;r.clearRect(0,0,r.canvas.width,r.canvas.height),r.textAlign="left",r.textBaseline="top",r.font=h-2+"px sans-serif",r.lineWidth=2,r.fillStyle="white",r.strokeStyle="black";const{debugSlot:o}=t;let i=g+_*o;const s=`${o}) ${t.key.id} (${t.constructor.name})`;r.strokeText(s,g,i),r.fillText(s,g,i),i+=h;const{debugInfo:n}=t;if(n){const{length:e,minOrderedLength:t,minUnorderedLength:o,triangleCount:s}=n.display;if(e>0){const t=`Length: ${e}`;r.strokeText(t,g,i),r.fillText(t,g,i),i+=h}if(t){const e=`Min ordered length: ${t}`;r.strokeText(e,g,i),r.fillText(e,g,i),i+=h}if(o){const e=`Min unordered length: ${o}`;r.strokeText(e,g,i),r.fillText(e,g,i),i+=h}if(s>0){s>1e5&&(r.fillStyle="red",r.strokeStyle="white");const e=`Triangle count: ${s}`;r.strokeText(e,g,i),r.fillText(e,g,i),i+=h}const{bytesUsed:l,bytesReserved:a}=n.memory;if(r.fillStyle="white",r.strokeStyle="black",l>0||a>0){const e=`Memory usage: ${l} of ${a} bytes`;r.strokeText(e,g,i),r.fillText(e,g,i),i+=h}}return t.tileDebugInfoTexture.setData(r.canvas),t.tileDebugInfoTexture}}export{x 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{nextPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as s}from"../definitions.js";import a from"./WGLBrush.js";import{
|
|
5
|
+
import{nextPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{vtlTextureBindingUnitSprites as i,vtlHighResCutoff as s}from"../definitions.js";import a from"./WGLBrush.js";import{PrimitiveType as n}from"../../../../webgl/enums.js";import{VertexArrayObject as c}from"../../../../webgl/VertexArrayObject.js";import{VertexBuffer as l}from"../../../../webgl/VertexBuffer.js";class m extends a{constructor(){super(...arguments),this._color=o(1,0,0,1),this._patternMatrix=e(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao=r(this._vao)}drawMany(r,e){const{context:o,painter:a,requestRender:c,allowDelayedRender:l}=r;this._loadWGLResources(r);const m=r.displayLevel,f=r.styleLayer,u=f.backgroundMaterial,p=a.vectorTilesMaterialManager,_=f.getPaintValue("background-color",m),d=f.getPaintValue("background-opacity",m),g=f.getPaintValue("background-pattern",m),h=void 0!==g,x=1|window.devicePixelRatio,y=r.spriteMosaic;let M,b;const v=x>s?2:1,w=this._programOptions;w.pattern=h;const j=p.getMaterialProgram(o,u,w);if(!l||null==c||j.compiled){if(o.bindVAO(this._vao),o.useProgram(j),h){const t=y.getMosaicItemPosition(g,!0);if(null!=t){const{tl:r,br:e,page:s}=t;M=e[0]-r[0],b=e[1]-r[1];const a=y.getPageSize(s);null!=a&&(y.bind(o,9729,s,i),j.setUniform4f("u_tlbr",r[0],r[1],e[0],e[1]),j.setUniform2fv("u_mosaicSize",a),j.setUniform1i("u_texture",i))}j.setUniform1f("u_opacity",d)}else{const t=_[3]*d;this._color[0]=t*_[0],this._color[1]=t*_[1],this._color[2]=t*_[2],this._color[3]=t,j.setUniform4fv("u_color",this._color)}j.setUniform1f("u_depth",f.z||0);for(const r of e){if(j.setUniform1f("u_coord_range",r.rangeX),j.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3),h){const e=Math.max(2**(Math.round(m)-r.key.level),1),o=v*r.width*e,i=o/t(M),s=o/t(b);this._patternMatrix[0]=i,this._patternMatrix[4]=s,j.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}o.setStencilFunction(514,0,255),o.drawArrays(n.TRIANGLE_STRIP,0,4)}}else c()}_loadWGLResources(t){if(this._vao)return;const{context:r,styleLayer:e}=t,o=e.backgroundMaterial,i=new Int8Array([0,0,1,0,0,1,1,1]),s=new l(r,o.geometryLayout,i);this._vao=new c(r,s)}}export{m as WGLBrushVTLBackground};
|
|
@@ -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{assertIsSome as t}from"../../../../../core/maybe.js";import{toUint32 as i,toFloat32 as
|
|
5
|
+
import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{toUint32 as i,toFloat32 as e}from"../number.js";import{PooledUint32Array as r}from"../PooledUint32Array.js";import{FreeList as s}from"./FreeList.js";import{BufferObject as n}from"../../../../webgl/BufferObject.js";import{VertexBuffer as h}from"../../../../webgl/VertexBuffer.js";const a=1.25,d=32767,u=d<<16|d;class f{constructor(t,i,e,s){this.bufferType=t,this.size=i,this.strideInt=e,this._pool=s,this._cpu=r.create(i*e*Uint32Array.BYTES_PER_ELEMENT,this._pool),this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:i*e*Uint32Array.BYTES_PER_ELEMENT},this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new s({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(t){if(this.maxAvailableSpace()>=t)return;if(t*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const i=this._cpu.length/this.strideInt,e=Math.round((i+t)*a),r=e*this.strideInt;this._cpu.expand(r*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(i,e-i),this.memoryStats.bytesReserved+=(e-i)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}setU32(t,i){this._cpu.array[t]!==i&&(this._cpu.array[t]=i,this.dirty.start=Math.min(t,this.dirty.start),this.dirty.end=Math.max(t+1,this.dirty.end))}setF32(t,e){this.setU32(t,i(e))}setF32Range(t,e,r){const s=i(r);this._cpu.array.fill(s,t,e),this.dirty.start=Math.min(t,this.dirty.start),this.dirty.end=Math.max(e,this.dirty.end)}getF32(t){return e(this._cpu.array[t])}getVertexBuffer(t,i){return"vertex"===this.bufferType?this._getGPUBuffer(t,i):null}getIndexBuffer(t,i){return"index"===this.bufferType?this._getGPUBuffer(t,null,i):null}_getGPUBuffer(t,i,e=!1){if(this.bufferSize){if(e){if("index"!==this.bufferType)throw new Error("Tried to get triangle buffer, but target is not an index buffer");return null==this._gpuComputeTriangles&&(this._gpuComputeTriangles=this._createComputeBuffer(t)),this._gpuComputeTriangles}return this._gpu??="index"===this.bufferType?n.createIndex(t,35048,this._cpu.array):i&&new h(t,i,this._cpu.array,35048),this._gpu}}getView(t,i){return this._cpu.getUint32View(t,i/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(i,e,r,s){const n=r*this.strideInt;if(!n)return 0;const h=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(i,h,n),d=this.freeList.firstFit(r);t(d,"First fit region must be defined");const u=d*this.strideInt,f=n;if(this._cpu.array.set(a,u),0!==s)for(let t=0;t<a.length;t++)this._cpu.array[t+u]+=s;return this.dirty.start=Math.min(this.dirty.start,u),this.dirty.end=Math.max(this.dirty.end,u+f),this.fillPointer=Math.max(this.fillPointer,u+f),this.memoryStats.bytesUsed+=r*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,d}copyFrom(i,e,r,s,n){const h=r*this.strideInt;if(!h)return 0;const a=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,d=i._cpu.getUint32View(a,h),u=this.freeList.firstFit(r);t(u,"First fit region must be defined");const f=u*this.strideInt,o=h;if(this._cpu.array.set(d,f),0!==s)for(let t=0;t<h;t++)this._cpu.array[f+t*this.strideInt+n]+=s;return this.dirty.start=Math.min(this.dirty.start,f),this.dirty.end=Math.max(this.dirty.end,f+o),this.fillPointer=Math.max(this.fillPointer,f+o),this.memoryStats.bytesUsed+=r*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,u}free(t,i,e){const r=t*this.strideInt,s=(t+i)*this.strideInt;if(!0===e)for(let n=t;n!==t+i;n++)this._cpu.array[n*this.strideInt]=u;this.dirty.start=Math.min(this.dirty.start,r),this.dirty.end=Math.max(this.dirty.end,s),this.freeList.free(t,i),this.memoryStats.bytesUsed-=i*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}upload(){if(this.dirty.end){if(this._invalidateTriangleBuffer(),null==this._gpu)return this.dirty.start=1/0,void(this.dirty.end=0);this._gpu.setSubData(this._cpu.array,this.dirty.start,this.dirty.start,this.dirty.end),this.dirty.start=1/0,this.dirty.end=0}}reshuffle(t,i){if(0===i.length)return;const e=this.byteSize,s=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,n=e>s,h=this._cpu,a=r.create(s,this._pool);n||a.array.set(this._cpu.getUint32View(0,this.intSize));for(const r of i)if(n||r.srcFrom!==r.dstFrom||0!==r.mutate){this.dirty.start=Math.min(this.dirty.start,r.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(r.dstFrom+r.count)*this.strideInt);for(let t=0;t<r.count;t++){const i=(r.dstFrom+t)*this.strideInt,e=(r.srcFrom+t)*this.strideInt;for(let t=0;t<this.strideInt;t++)a.array[i+t]=h.array[e+t]+r.mutate}}this._cpu.destroy(),this._cpu=a,n&&this.invalidate(),this.freeList.clear(),this.memoryStats.bytesUsed=this.memoryStats.bytesReserved=s}_createComputeBuffer(t){const i=35048,e=new Uint32Array(this.fillPointer/3);for(let r=0;r<this.fillPointer;r+=3)e[r/3]=this._cpu.array[r];return n.createIndex(t,i,e)}}export{f as MappedBuffer};
|