@arcgis/core 4.34.0-next.41 → 4.34.0-next.43
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/Basemap.js +1 -1
- package/Ground.js +1 -1
- package/PopupTemplate.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- 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/07eea90733834313e9fa.js +1 -0
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +1 -0
- package/assets/esri/core/workers/chunks/0ebf666564d323d82259.js +1 -0
- package/assets/esri/core/workers/chunks/1a3a4c2c642899be37a0.js +1 -0
- package/assets/esri/core/workers/chunks/20ffac42ff5095af00fe.js +1 -0
- package/assets/esri/core/workers/chunks/{d465e1b3a8a53d9c0a12.js → 24e76fa530fc0c495fb5.js} +1 -1
- package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +1 -0
- package/assets/esri/core/workers/chunks/{9247d768c3eccc0828a9.js → 28d71e1b866113650c75.js} +1 -1
- package/assets/esri/core/workers/chunks/{85bfd380d4f522ff8e83.js → 2ae50b02cdf126a8b562.js} +1 -1
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +1 -0
- package/assets/esri/core/workers/chunks/345ed9ac44e47355803e.js +1 -0
- package/assets/esri/core/workers/chunks/5ae6e2b3557fe8730072.js +1 -0
- package/assets/esri/core/workers/chunks/5f28470304b57e24d94c.js +1 -0
- package/assets/esri/core/workers/chunks/{6c167daf115cd6abb3e5.js → 615915e7c48f0a3d0060.js} +1 -1
- package/assets/esri/core/workers/chunks/655b8d24ffe5405f8ba1.js +1 -0
- package/assets/esri/core/workers/chunks/68a69d3fcad6febf55f6.js +22 -0
- package/assets/esri/core/workers/chunks/6b73926feb5c5d957062.js +1 -0
- package/assets/esri/core/workers/chunks/6cd828cfe41e0cab2068.js +1 -0
- package/assets/esri/core/workers/chunks/{6269c4bbf0f224a954e9.js → 6f4079b7a2b45f304ee6.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad106f5f6d6848f40de3.js → 71b222089f5e9dcee474.js} +1 -1
- package/assets/esri/core/workers/chunks/{962c0ef63de1635fb4aa.js → 7e99fc78bd0f40a8ba81.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a27f9b11d03874809ee.js → 8867368ab9b005460f19.js} +17 -10
- package/assets/esri/core/workers/chunks/892623d938583cd0f006.js +1 -0
- package/assets/esri/core/workers/chunks/99daf4b144838fa9ca67.js +1 -0
- package/assets/esri/core/workers/chunks/{31ad9949b08a5b07218c.js → 9aa84b86262fa8334bc4.js} +22 -21
- package/assets/esri/core/workers/chunks/{cca36750c86352c6d1f9.js → a638f1688ac9525a52a7.js} +1 -1
- package/assets/esri/core/workers/chunks/ab3c018c406dcd81ef9e.js +1 -0
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +1 -0
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +1 -0
- package/assets/esri/core/workers/chunks/{9e7af4c3c0f8cf0f5c5b.js → b4251e10621fb3ad03a3.js} +1 -1
- package/assets/esri/core/workers/chunks/b79aa5ba0424641f878b.js +1 -0
- package/assets/esri/core/workers/chunks/b85dbefdb09bc6c99e0d.js +1 -0
- package/assets/esri/core/workers/chunks/bb56defb6dfb9b2c1f27.js +1 -0
- package/assets/esri/core/workers/chunks/c47227a626edc1e1ecf1.js +1 -0
- package/assets/esri/core/workers/chunks/c6da9ba188b627ab3b79.js +1 -0
- package/assets/esri/core/workers/chunks/{9c60599131860f635483.js → cd6398a2951922e13b86.js} +1 -1
- package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +1 -0
- package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +1 -0
- package/assets/esri/core/workers/chunks/{7d082bfcd13ad6e8c89d.js → d552b22219ec795aff89.js} +1 -1
- package/assets/esri/core/workers/chunks/{94850c094e076d81a016.js → dca2b487152cde45fb65.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f523fa4d4ade4316625.js → e19cd07df8ce87e18832.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8d57588267e2fc4406c.js → e3f5afdf133c58b3d161.js} +1 -1
- package/assets/esri/core/workers/chunks/e505a101621de39de280.js +1 -0
- package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +1 -0
- package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{712c740cf58c2e282efc.js → e962e6b47cb7e5a71c24.js} +1 -1
- package/assets/esri/core/workers/chunks/{88308a0dcc479688e67c.js → f1adf8ebc2c1b93857bf.js} +1 -1
- package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +1 -0
- package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +1 -0
- package/assets/esri/core/workers/chunks/f667096ea325f690c4a6.js +1 -0
- package/assets/esri/core/workers/chunks/fe55833c80cf59df9c2b.js +1 -0
- package/assets/esri/core/workers/chunks/fe6fa1f2c2d54d41645e.js +1 -0
- package/chunks/ComponentShader.glsl.js +6 -5
- package/config.js +1 -1
- package/core/floatRGBA.js +1 -1
- package/core/workers/registry.js +1 -1
- package/graphic/graphicOrigins.d.ts +2 -0
- package/interfaces.d.ts +281 -124
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GraphicsLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/MediaLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/support/BuildingFilter.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/MapImage.js +1 -1
- package/networks/Network.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalItem.js +1 -1
- package/renderers/DotDensityRenderer.js +1 -1
- package/renderers/FlowRenderer.js +1 -1
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/ColormapInfo.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/support/AttributeBinsFeatureSet.js +1 -1
- package/rest/support/DirectionsFeature.js +1 -1
- package/rest/support/FindImagesParameters.js +1 -1
- package/rest/support/ImageAreaParameters.js +1 -1
- package/rest/support/ImageBoundaryParameters.js +1 -1
- package/rest/support/ImageDistanceParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHeightParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImagePixelLocationParameters.js +1 -1
- package/rest/support/ImagePointParameters.js +1 -1
- package/rest/support/ImageToMapMultirayParameters.js +1 -1
- package/rest/support/ImageToMapParameters.js +1 -1
- package/rest/support/ImageUrlParameters.js +1 -1
- package/rest/support/MapToImageParameters.js +1 -1
- package/rest/support/MeasureFromImageParameters.js +1 -1
- package/support/revision.js +1 -1
- package/versionManagement/VersionManagementService.js +1 -1
- package/versionManagement/VersioningState.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/GlyphMosaic.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/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/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.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/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/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.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/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/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +21 -14
- package/views/3d/webgl-engine/collections/Component/UniformComponentParameters.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js +7 -0
- 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/RenderingContext.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/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +7 -6
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/Draw.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/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/FeatureForm/GroupInput.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/00ae094cc21bc42faa54.js +0 -1
- package/assets/esri/core/workers/chunks/01bd8f90e55081e65b38.js +0 -1
- package/assets/esri/core/workers/chunks/1cd15aa69f85ecfa32b0.js +0 -1
- package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +0 -1
- package/assets/esri/core/workers/chunks/2ae0bda04fd5386b462f.js +0 -1
- package/assets/esri/core/workers/chunks/31e6eb2685872baf538a.js +0 -1
- package/assets/esri/core/workers/chunks/3358c1b04490706681cc.js +0 -1
- package/assets/esri/core/workers/chunks/34f677e8c1691c10e4e9.js +0 -1
- package/assets/esri/core/workers/chunks/364fb103cb139f26b455.js +0 -1
- package/assets/esri/core/workers/chunks/4ae15645e68e7f6dd6b7.js +0 -1
- package/assets/esri/core/workers/chunks/5156410dd84ea1232a6c.js +0 -1
- package/assets/esri/core/workers/chunks/560bb06cf1bf30df4af3.js +0 -1
- package/assets/esri/core/workers/chunks/5f11fff5bc16fdec42db.js +0 -1
- package/assets/esri/core/workers/chunks/647cff1eaaf1b622f439.js +0 -1
- package/assets/esri/core/workers/chunks/6b5b609b357924fa35be.js +0 -1
- package/assets/esri/core/workers/chunks/719b89341b26c3568c2f.js +0 -1
- package/assets/esri/core/workers/chunks/791b3130b34b52160c1f.js +0 -1
- package/assets/esri/core/workers/chunks/79b389baf972d329c38d.js +0 -1
- package/assets/esri/core/workers/chunks/7a5808c6e67c43274d86.js +0 -1
- package/assets/esri/core/workers/chunks/7ef7f3925495b9ade88c.js +0 -1
- package/assets/esri/core/workers/chunks/90a9b618058dc41294de.js +0 -1
- package/assets/esri/core/workers/chunks/95f0c15d83d1f38e01d0.js +0 -1
- package/assets/esri/core/workers/chunks/a13a36207f265f720255.js +0 -1
- package/assets/esri/core/workers/chunks/a36be186ad10200c420c.js +0 -1
- package/assets/esri/core/workers/chunks/ad1e5c24c1eae5ab8e45.js +0 -1
- package/assets/esri/core/workers/chunks/b481807b31e59cce9931.js +0 -1
- package/assets/esri/core/workers/chunks/bc27cdd7c415ab166536.js +0 -1
- package/assets/esri/core/workers/chunks/c52314b987c63cd630f7.js +0 -1
- package/assets/esri/core/workers/chunks/d1635a7ab0c204852237.js +0 -1
- package/assets/esri/core/workers/chunks/da228aed337f492456cc.js +0 -1
- package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +0 -1
- package/assets/esri/core/workers/chunks/e95a8c988ef822723503.js +0 -1
- package/assets/esri/core/workers/chunks/ec9ed7c9d64f88fcb806.js +0 -1
- package/assets/esri/core/workers/chunks/fd3009164d5e38fda85f.js +0 -1
|
@@ -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 r from"../core/Error.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as i}from"../core/Loadable.js";import{removeTrailingSlash as n,Url as o}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{onApplyEditsEvent as d,emitUpdateMomentEvent as m}from"../layers/mixins/EditBusLayer.js";import{parseUrl as f}from"../rest/utils.js";import g from"./support/EditMomentStack.js";import{versionCollection as p,versionCollectionCount as h,defaultVersionNameLookup as V,currentSessionId as v}from"./support/versionManagementUtils.js";import{createVersionAdapters as y}from"./versionAdapters/utils.js";let w=class extends(s(i)){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.name=null,this.defaultVersionIdentifier=null,this.capabilities=null,this._isDefault=e=>!e||e===this.defaultVersionIdentifier.name,this._dateEquals=(e,t)=>!e&&!t||!(!e||!t)&&e.toISOString()===t.toISOString(),this._applyEditsHandler=e=>{const{serviceUrl:t,gdbVersion:r,result:s}=e;t===this._featureServiceUrl&&s.then(e=>{const t=e.historicMoment;t&&this._addMomentToVersionItem(r,t)})}}initialize(){this.url=n(this.url),this._featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),p.has(this.url)||p.set(this.url,new Map);const e=(h.get(this.url)??0)+1;h.set(this.url,e),this.when().then(()=>this.addHandles(d(this._applyEditsHandler)),()=>{})}destroy(){const e=(h.get(this.url)??1)-1;h.set(this.url,e),0===e&&p.delete(this.url),V.delete(this._featureServiceUrl)}read(e,t){this.sourceJSON=e,super.read(e,t)}readDefaultVersionIdentifier(e,t){return{name:t.defaultVersionName,guid:t.defaultVersionGuid}}writeDefaultVersionIdentifier(e,t){t.defaultVersionName=e.name,t.defaultVersionGuid=e.guid}load(e){return this.addResolvingPromise(this._fetchService(this.url,e)),Promise.resolve(this)}async createVersion(e){const[{createVersion:t},{default:r}]=await Promise.all([import("../rest/versionManagement/createVersion.js"),import("../rest/versionManagement/support/CreateVersionParameters.js")]),s=r.from(e);return t(this.url,s)}async deleteVersion(e){const[{deleteVersion:t},{default:r}]=await Promise.all([import("../rest/versionManagement/deleteVersion.js"),import("../rest/versionManagement/support/DeleteVersionParameters.js")]);let s;e.guid&&p.get(this.url)?.has(e.guid)&&(s=v??void 0);const i=new r({versionName:e.name,sessionId:s});return t(this.url,i)}async getVersionInfoExtended(e){const{getVersion:t}=await import("../rest/versionManagement/getVersion.js");return t(this.url,e.guid)}async getVersionInfos(e={}){const[{getVersionInfos:t},{default:r}]=await Promise.all([import("../rest/versionManagement/getVersionInfos.js"),import("../rest/versionManagement/support/GetVersionInfosParameters.js")]),s=r.from(e);return t(this.url,s)}async reconcile(e,t={}){const[{reconcile:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/reconcile.js"),import("../rest/versionManagement/gdbVersion/support/ReconcileParameters.js")]),i=s.from(t);return i.sessionId=v,r(this.url,e.guid,i)}async post(e){const[{post:t},{default:r}]=await Promise.all([import("../rest/versionManagement/gdbVersion/post.js"),import("../rest/versionManagement/gdbVersion/support/PostParameters.js")]),s=r.from({sessionId:v});return t(this.url,e.guid,s)}async alterVersion(e,t){const[{alterVersion:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/alterVersion.js"),import("../rest/versionManagement/gdbVersion/support/AlterVersionParameters.js")]),i=s.from(t);return r(this.url,e.guid,i)}async startReading(e){return(await this.startReadingWithResult(e)).success}async startReadingWithResult(e){const{startReading:t}=await import("../rest/versionManagement/gdbVersion/startReading.js"),r=await t(this.url,e.guid,v);if(r.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate),s={name:t.versionIdentifier.name,moment:r,lockType:"read"};this._addOrUpdateItem(e.guid,s),m(this._featureServiceUrl,null,e.name,r)}return r}async stopReading(e){return(await this.stopReadingWithResult(e)).success}async stopReadingWithResult(e){const{stopReading:t}=await import("../rest/versionManagement/gdbVersion/stopReading.js"),r=await t(this.url,e.guid,v);return r.success&&(p.get(this.url)?.delete(e.guid),m(this._featureServiceUrl,null,e.name,null)),r}async startEditing(e){return(await this.startEditingWithResult(e)).success}async startEditingWithResult(e){const{startEditing:t}=await import("../rest/versionManagement/gdbVersion/startEditing.js"),r=await t(this.url,e.guid,v);if(r.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate),s=new g(r),i={name:e.name,moment:r,lockType:"edit",stack:s};this._addOrUpdateItem(e.guid,i),m(this._featureServiceUrl,null,e.name,r)}return r}async stopEditing(e,t){return(await this.stopEditingWithResult(e,t)).success}async stopEditingWithResult(e,t){if(t){const t=p.get(this.url)?.get(e.guid);if(t?.stack?.canRedo()){const[{deleteForwardEdits:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/deleteForwardEdits.js"),import("../rest/versionManagement/gdbVersion/support/DeleteForwardEditsParameters.js")]),i=await r(this.url,e.guid,new s({sessionId:v,moment:t.moment}));if(!i.success)return i}}const{stopEditing:r}=await import("../rest/versionManagement/gdbVersion/stopEditing.js"),s=await r(this.url,e.guid,v,t);if(s.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate);this._addOrUpdateItem(e.guid,{name:e.name,moment:r,lockType:"read",editMomentStack:void 0}),m(this._featureServiceUrl,null,e.name,r)}return s}getLockType(e){const t=p.get(this.url)?.get(e.guid)?.lockType;return t??"none"}async changeVersion(e,t,s){if(s&&"name"in s&&!await this.getVersionInfoExtended(s))throw new r("version-management-service:invalid-version","version does not exist");if("networkServiceUrl"in e){if(this._featureServiceUrl.toLowerCase()===e.featureServiceUrl.toLowerCase())return this._changeVersionInternal(e,t,s)}else{let r;"layers"in e?(r=e.allTables.concat(e.allLayers),e.utilityNetworks&&e.utilityNetworks.forEach(e=>{this._featureServiceUrl.toLowerCase()===e.featureServiceUrl.toLowerCase()&&this._changeVersionInternal(e,t,s)})):r=e;for(const e of r)if("feature"===e.type||"subtype-group"===e.type){const r=/^(.*\/FeatureServer)\/\d+$/,i=e.url.replace(r,"$1");if(this._featureServiceUrl.toLowerCase()===i.toLowerCase()&&!this._changeVersionInternal(e,t,s))return!1}else if("group"===e.type){const r=e.allTables.concat(e.allLayers);for(const e of r)if("feature"===e.type||"subtype-group"===e.type){const r=/^(.*\/FeatureServer)\/\d+$/,i=e.url.replace(r,"$1");if(this._featureServiceUrl.toLowerCase()===i.toLowerCase()&&!this._changeVersionInternal(e,t,s))return!1}}}return!0}async changeVersionWithResult(e,t,r){let s;if("layers"in e){const t=y(e.allTables.concat(e.allLayers).filter(e=>"group"!==e.type).toArray());e.utilityNetworks&&e.utilityNetworks.forEach(e=>{const r=y([e]);t.push(...r)}),s=t}else s=e;if(r&&"name"in r){if(!await this.getVersionInfoExtended(r)){const e=new Map;for(const t of s)e.set(t,{success:!1});return e}}if(t&&"name"in t){if("none"!==this.getLockType(t)){const e=new Map;for(const t of s)e.set(t,{success:!1});return e}}const i=new Map;for(const n of s)if(n)if(n.featureServiceUrl.toLowerCase()===this._featureServiceUrl.toLowerCase()){const e=this._changeVersionInternalWithResult(n,t,r);i.set(n,e)}else i.set(n,{success:!1});return i}async getVersionIdentifierFromName(e){try{const t=await this.getVersionInfos({includeHidden:!0});return t.find(t=>t.versionIdentifier.name.toUpperCase()===e.toUpperCase())?.versionIdentifier||null}catch{return null}}async getVersionIdentifierFromGuid(e){const{getVersion:t}=await import("../rest/versionManagement/getVersion.js");try{return(await t(this.url,e)).versionIdentifier}catch{return null}}canUndo(e){const t=p.get(this.url)?.get(e.guid);return!!t?.stack?.canUndo()}canRedo(e){const t=p.get(this.url)?.get(e.guid);return!!t?.stack?.canRedo()}undo(e){const t=p.get(this.url)?.get(e.guid),r=t?.stack?.undo()||void 0;if(t&&r){const r=t.stack.peek();m(this._featureServiceUrl,null,e.name,r),p.get(this.url)?.set(e.guid,{...t,moment:r})}}redo(e){const t=p.get(this.url)?.get(e.guid),r=t?.stack?.redo()||void 0;t&&r&&(m(this._featureServiceUrl,null,e.name,r),p.get(this.url)?.set(e.guid,{...t,moment:r}))}_setUpData(e,t){let s=null,i=null,n=null,o=null;const a=e=>{const t=p?.get(this.url)?.get(e.guid);n=e.name,o=t?.moment??null};if(e&&"name"in e){if("none"!==this.getLockType(e))throw new r("version-management-service:version-locked","version is locked");s=e.name,i=null,t&&"name"in t?a(t):(n=this.defaultVersionIdentifier.name,o=t)}else s=this.defaultVersionIdentifier.name,i=e,t&&"name"in t?a(t):(n=this.defaultVersionIdentifier.name,o=t);return{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}}_changeVersionInternal(e,t,r){try{const{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}=this._setUpData(t,r);(this._isDefault(s)&&this._isDefault(e.gdbVersion)&&this._dateEquals(e.historicMoment,i)||s===e.gdbVersion&&this._dateEquals(e.historicMoment,i))&&(e.gdbVersion=n,e.historicMoment=o)}catch(s){return!1}return!0}_changeVersionInternalWithResult(e,t,r){try{const{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}=this._setUpData(t,r);return this._isDefault(s)&&this._isDefault(e.gdbVersion)&&this._dateEquals(e.historicMoment,i)||s===e.gdbVersion&&this._dateEquals(e.historicMoment,i)?(e.gdbVersion=n,e.historicMoment=o,{success:!0}):{success:!1}}catch(s){return{success:!1}}}_addMomentToVersionItem(e,t){const r=p.get(this.url);if(r)for(const[s,i]of r){i.name===e&&this._addToStack(s,t)}}_addToStack(e,t){const r=p.get(this.url),s=r?.get(e);return!!s?.stack&&(I(s.stack.peek(),t)&&s.stack.push(t),r.set(e,{...s,moment:t}),!0)}_addOrUpdateItem(e,t){const r=p.get(this.url),s=r?.get(e);return s?(r.set(e,{...s,...t}),!0):!(!t.name||!t.lockType)&&(r?.set(e,{...t,lockType:t.lockType}),!0)}async _fetchService(e,r){if(this.sourceJSON){this.read(this.sourceJSON,{origin:"service",url:f(e)});const t=new o(this.url).host;return void V.set(t,this.defaultVersionIdentifier.name)}const s=await t(e,{responseType:"json",query:{f:"json"},...r});this.read(s.data)}};function I(e,t){if(e){return e.getTime()<t.getTime()}return!0}e([a()],w.prototype,"url",void 0),e([a()],w.prototype,"sourceJSON",void 0),e([a({type:String,json:{write:!0}})],w.prototype,"name",void 0),e([a({json:{write:{target:{defaultVersionName:{type:String},defaultVersionGuid:{type:String}}},read:{source:["defaultVersionName","defaultVersionGuid"]}}})],w.prototype,"defaultVersionIdentifier",void 0),e([u("defaultVersionIdentifier",["defaultVersionName","defaultVersionGuid"])],w.prototype,"readDefaultVersionIdentifier",null),e([c("defaultVersionIdentifier",{defaultVersionName:{type:String},defaultVersionGuid:{type:String}})],w.prototype,"writeDefaultVersionIdentifier",null),e([a({json:{write:!0}})],w.prototype,"capabilities",void 0),w=e([l("esri.versionManagement.VersionManagementService")],w);const S=w;export{S as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as i}from"../core/Loadable.js";import{removeTrailingSlash as n,Url as o}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{onApplyEditsEvent as c,emitUpdateMomentEvent as m}from"../layers/mixins/EditBusLayer.js";import{parseUrl as f}from"../rest/utils.js";import g from"./support/EditMomentStack.js";import{versionCollection as p,versionCollectionCount as h,defaultVersionNameLookup as V,currentSessionId as v}from"./support/versionManagementUtils.js";import{createVersionAdapters as y}from"./versionAdapters/utils.js";let w=class extends(s(i)){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.name=null,this.defaultVersionIdentifier=null,this.capabilities=null,this._isDefault=e=>!e||e===this.defaultVersionIdentifier.name,this._dateEquals=(e,t)=>!e&&!t||!(!e||!t)&&e.toISOString()===t.toISOString(),this._applyEditsHandler=e=>{const{serviceUrl:t,gdbVersion:r,result:s}=e;t===this._featureServiceUrl&&s.then(e=>{const t=e.historicMoment;t&&this._addMomentToVersionItem(r,t)})}}initialize(){this.url=n(this.url),this._featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),p.has(this.url)||p.set(this.url,new Map);const e=(h.get(this.url)??0)+1;h.set(this.url,e),this.when().then(()=>this.addHandles(c(this._applyEditsHandler)),()=>{})}destroy(){const e=(h.get(this.url)??1)-1;h.set(this.url,e),0===e&&p.delete(this.url),V.delete(this._featureServiceUrl)}read(e,t){this.sourceJSON=e,super.read(e,t)}readDefaultVersionIdentifier(e,t){return{name:t.defaultVersionName,guid:t.defaultVersionGuid}}writeDefaultVersionIdentifier(e,t){t.defaultVersionName=e.name,t.defaultVersionGuid=e.guid}get loaded(){return super.loaded}load(e){return this.addResolvingPromise(this._fetchService(this.url,e)),Promise.resolve(this)}async createVersion(e){const[{createVersion:t},{default:r}]=await Promise.all([import("../rest/versionManagement/createVersion.js"),import("../rest/versionManagement/support/CreateVersionParameters.js")]),s=r.from(e);return t(this.url,s)}async deleteVersion(e){const[{deleteVersion:t},{default:r}]=await Promise.all([import("../rest/versionManagement/deleteVersion.js"),import("../rest/versionManagement/support/DeleteVersionParameters.js")]);let s;e.guid&&p.get(this.url)?.has(e.guid)&&(s=v??void 0);const i=new r({versionName:e.name,sessionId:s});return t(this.url,i)}async getVersionInfoExtended(e){const{getVersion:t}=await import("../rest/versionManagement/getVersion.js");return t(this.url,e.guid)}async getVersionInfos(e={}){const[{getVersionInfos:t},{default:r}]=await Promise.all([import("../rest/versionManagement/getVersionInfos.js"),import("../rest/versionManagement/support/GetVersionInfosParameters.js")]),s=r.from(e);return t(this.url,s)}async reconcile(e,t={}){const[{reconcile:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/reconcile.js"),import("../rest/versionManagement/gdbVersion/support/ReconcileParameters.js")]),i=s.from(t);return i.sessionId=v,r(this.url,e.guid,i)}async post(e){const[{post:t},{default:r}]=await Promise.all([import("../rest/versionManagement/gdbVersion/post.js"),import("../rest/versionManagement/gdbVersion/support/PostParameters.js")]),s=r.from({sessionId:v});return t(this.url,e.guid,s)}async alterVersion(e,t){const[{alterVersion:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/alterVersion.js"),import("../rest/versionManagement/gdbVersion/support/AlterVersionParameters.js")]),i=s.from(t);return r(this.url,e.guid,i)}async startReading(e){return(await this.startReadingWithResult(e)).success}async startReadingWithResult(e){const{startReading:t}=await import("../rest/versionManagement/gdbVersion/startReading.js"),r=await t(this.url,e.guid,v);if(r.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate),s={name:t.versionIdentifier.name,moment:r,lockType:"read"};this._addOrUpdateItem(e.guid,s),m(this._featureServiceUrl,null,e.name,r)}return r}async stopReading(e){return(await this.stopReadingWithResult(e)).success}async stopReadingWithResult(e){const{stopReading:t}=await import("../rest/versionManagement/gdbVersion/stopReading.js"),r=await t(this.url,e.guid,v);return r.success&&(p.get(this.url)?.delete(e.guid),m(this._featureServiceUrl,null,e.name,null)),r}async startEditing(e){return(await this.startEditingWithResult(e)).success}async startEditingWithResult(e){const{startEditing:t}=await import("../rest/versionManagement/gdbVersion/startEditing.js"),r=await t(this.url,e.guid,v);if(r.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate),s=new g(r),i={name:e.name,moment:r,lockType:"edit",stack:s};this._addOrUpdateItem(e.guid,i),m(this._featureServiceUrl,null,e.name,r)}return r}async stopEditing(e,t){return(await this.stopEditingWithResult(e,t)).success}async stopEditingWithResult(e,t){if(t){const t=p.get(this.url)?.get(e.guid);if(t?.stack?.canRedo()){const[{deleteForwardEdits:r},{default:s}]=await Promise.all([import("../rest/versionManagement/gdbVersion/deleteForwardEdits.js"),import("../rest/versionManagement/gdbVersion/support/DeleteForwardEditsParameters.js")]),i=await r(this.url,e.guid,new s({sessionId:v,moment:t.moment}));if(!i.success)return i}}const{stopEditing:r}=await import("../rest/versionManagement/gdbVersion/stopEditing.js"),s=await r(this.url,e.guid,v,t);if(s.success){const t=await this.getVersionInfoExtended(e),r=new Date(t.modifiedDate);this._addOrUpdateItem(e.guid,{name:e.name,moment:r,lockType:"read",editMomentStack:void 0}),m(this._featureServiceUrl,null,e.name,r)}return s}getLockType(e){const t=p.get(this.url)?.get(e.guid)?.lockType;return t??"none"}async changeVersion(e,t,s){if(s&&"name"in s&&!await this.getVersionInfoExtended(s))throw new r("version-management-service:invalid-version","version does not exist");if("networkServiceUrl"in e){if(this._featureServiceUrl.toLowerCase()===e.featureServiceUrl.toLowerCase())return this._changeVersionInternal(e,t,s)}else{let r;"layers"in e?(r=e.allTables.concat(e.allLayers),e.utilityNetworks&&e.utilityNetworks.forEach(e=>{this._featureServiceUrl.toLowerCase()===e.featureServiceUrl.toLowerCase()&&this._changeVersionInternal(e,t,s)})):r=e;for(const e of r)if("feature"===e.type||"subtype-group"===e.type){const r=/^(.*\/FeatureServer)\/\d+$/,i=e.url.replace(r,"$1");if(this._featureServiceUrl.toLowerCase()===i.toLowerCase()&&!this._changeVersionInternal(e,t,s))return!1}else if("group"===e.type){const r=e.allTables.concat(e.allLayers);for(const e of r)if("feature"===e.type||"subtype-group"===e.type){const r=/^(.*\/FeatureServer)\/\d+$/,i=e.url.replace(r,"$1");if(this._featureServiceUrl.toLowerCase()===i.toLowerCase()&&!this._changeVersionInternal(e,t,s))return!1}}}return!0}async changeVersionWithResult(e,t,r){let s;if("layers"in e){const t=y(e.allTables.concat(e.allLayers).filter(e=>"group"!==e.type).toArray());e.utilityNetworks&&e.utilityNetworks.forEach(e=>{const r=y([e]);t.push(...r)}),s=t}else s=e;if(r&&"name"in r){if(!await this.getVersionInfoExtended(r)){const e=new Map;for(const t of s)e.set(t,{success:!1});return e}}if(t&&"name"in t){if("none"!==this.getLockType(t)){const e=new Map;for(const t of s)e.set(t,{success:!1});return e}}const i=new Map;for(const n of s)if(n)if(n.featureServiceUrl.toLowerCase()===this._featureServiceUrl.toLowerCase()){const e=this._changeVersionInternalWithResult(n,t,r);i.set(n,e)}else i.set(n,{success:!1});return i}async getVersionIdentifierFromName(e){try{const t=await this.getVersionInfos({includeHidden:!0});return t.find(t=>t.versionIdentifier.name.toUpperCase()===e.toUpperCase())?.versionIdentifier||null}catch{return null}}async getVersionIdentifierFromGuid(e){const{getVersion:t}=await import("../rest/versionManagement/getVersion.js");try{return(await t(this.url,e)).versionIdentifier}catch{return null}}canUndo(e){const t=p.get(this.url)?.get(e.guid);return!!t?.stack?.canUndo()}canRedo(e){const t=p.get(this.url)?.get(e.guid);return!!t?.stack?.canRedo()}undo(e){const t=p.get(this.url)?.get(e.guid),r=t?.stack?.undo()||void 0;if(t&&r){const r=t.stack.peek();m(this._featureServiceUrl,null,e.name,r),p.get(this.url)?.set(e.guid,{...t,moment:r})}}redo(e){const t=p.get(this.url)?.get(e.guid),r=t?.stack?.redo()||void 0;t&&r&&(m(this._featureServiceUrl,null,e.name,r),p.get(this.url)?.set(e.guid,{...t,moment:r}))}_setUpData(e,t){let s=null,i=null,n=null,o=null;const a=e=>{const t=p?.get(this.url)?.get(e.guid);n=e.name,o=t?.moment??null};if(e&&"name"in e){if("none"!==this.getLockType(e))throw new r("version-management-service:version-locked","version is locked");s=e.name,i=null,t&&"name"in t?a(t):(n=this.defaultVersionIdentifier.name,o=t)}else s=this.defaultVersionIdentifier.name,i=e,t&&"name"in t?a(t):(n=this.defaultVersionIdentifier.name,o=t);return{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}}_changeVersionInternal(e,t,r){try{const{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}=this._setUpData(t,r);(this._isDefault(s)&&this._isDefault(e.gdbVersion)&&this._dateEquals(e.historicMoment,i)||s===e.gdbVersion&&this._dateEquals(e.historicMoment,i))&&(e.gdbVersion=n,e.historicMoment=o)}catch(s){return!1}return!0}_changeVersionInternalWithResult(e,t,r){try{const{fromVersionName:s,fromMoment:i,toVersionName:n,toMoment:o}=this._setUpData(t,r);return this._isDefault(s)&&this._isDefault(e.gdbVersion)&&this._dateEquals(e.historicMoment,i)||s===e.gdbVersion&&this._dateEquals(e.historicMoment,i)?(e.gdbVersion=n,e.historicMoment=o,{success:!0}):{success:!1}}catch(s){return{success:!1}}}_addMomentToVersionItem(e,t){const r=p.get(this.url);if(r)for(const[s,i]of r){i.name===e&&this._addToStack(s,t)}}_addToStack(e,t){const r=p.get(this.url),s=r?.get(e);return!!s?.stack&&(I(s.stack.peek(),t)&&s.stack.push(t),r.set(e,{...s,moment:t}),!0)}_addOrUpdateItem(e,t){const r=p.get(this.url),s=r?.get(e);return s?(r.set(e,{...s,...t}),!0):!(!t.name||!t.lockType)&&(r?.set(e,{...t,lockType:t.lockType}),!0)}async _fetchService(e,r){if(this.sourceJSON){this.read(this.sourceJSON,{origin:"service",url:f(e)});const t=new o(this.url).host;return void V.set(t,this.defaultVersionIdentifier.name)}const s=await t(e,{responseType:"json",query:{f:"json"},...r});this.read(s.data)}};function I(e,t){if(e){return e.getTime()<t.getTime()}return!0}e([a()],w.prototype,"url",void 0),e([a()],w.prototype,"sourceJSON",void 0),e([a({type:String,json:{write:!0}})],w.prototype,"name",void 0),e([a({json:{write:{target:{defaultVersionName:{type:String},defaultVersionGuid:{type:String}}},read:{source:["defaultVersionName","defaultVersionGuid"]}}})],w.prototype,"defaultVersionIdentifier",void 0),e([u("defaultVersionIdentifier",["defaultVersionName","defaultVersionGuid"])],w.prototype,"readDefaultVersionIdentifier",null),e([d("defaultVersionIdentifier",{defaultVersionName:{type:String},defaultVersionGuid:{type:String}})],w.prototype,"writeDefaultVersionIdentifier",null),e([a({json:{write:!0}})],w.prototype,"capabilities",void 0),w=e([l("esri.versionManagement.VersionManagementService")],w);const S=w;export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import r from"../core/Error.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as i}from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")}),this.versionableItems.on("before-remove",e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")})])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("versioning:failed-lock","Failed to acquire read lock for version: "+e);this._isDefaultOrHistoricVersion(this.currentVersion)||await this.versionManagementService.stopReading(this.currentVersion)}const s=await this.versionManagementService.changeVersionWithResult(this.versionableItems,this.currentVersion,e);let i=!1;return s.forEach((e,t)=>{i=i||e.success}),i&&(this.currentVersion=e,this.currentVersionInfo=t||await this.getVersionInfoExtended(),this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":this.state="read"!==this.versionManagementService.getLockType(this.currentVersion)?"lock-none":"lock-read"),s}async undo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.undo(this.currentVersion),{success:!0})}async redo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.redo(this.currentVersion),{success:!0})}async _setUpState(e){await this.versionManagementService.load(e),this.state="lock-none",this.currentVersionInfo=await this.getVersionInfoExtended(),this.versionableItems.forEach(e=>{this.currentVersion?"name"in this.currentVersion?(e.gdbVersion=this.currentVersion.name,e.historicMoment=null):(e.historicMoment=this.currentVersion,e.gdbVersion=null):(e.gdbVersion=null,e.historicMoment=null)}),this.usePersistentReadSessions&&(this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":await this.versionManagementService.startReading(this.currentVersion)&&(this.state="lock-read"))}_isDefaultOrHistoricVersion(e=this.currentVersion){return!(e&&"name"in e)||e.name===this.versionManagementService.defaultVersionIdentifier.name}};e([o()],c.prototype,"versionManagementService",void 0),e([o()],c.prototype,"featureServiceUrl",void 0),e([o()],c.prototype,"url",void 0),e([o()],c.prototype,"currentVersion",void 0),e([o()],c.prototype,"currentVersionInfo",void 0),e([o()],c.prototype,"versionInfos",void 0),e([o()],c.prototype,"versionableItems",void 0),e([o()],c.prototype,"usePersistentReadSessions",void 0),e([o()],c.prototype,"state",void 0),e([o({readOnly:!0})],c.prototype,"defaultVersionIdentifier",null),e([o({readOnly:!0})],c.prototype,"isDefault",null),c=e([a("esri.versionManagement.VersioningState")],c);const u=c;export{u as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import r from"../core/Error.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as i}from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")}),this.versionableItems.on("before-remove",e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")})])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}get loaded(){return super.loaded}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("versioning:failed-lock","Failed to acquire read lock for version: "+e);this._isDefaultOrHistoricVersion(this.currentVersion)||await this.versionManagementService.stopReading(this.currentVersion)}const s=await this.versionManagementService.changeVersionWithResult(this.versionableItems,this.currentVersion,e);let i=!1;return s.forEach((e,t)=>{i=i||e.success}),i&&(this.currentVersion=e,this.currentVersionInfo=t||await this.getVersionInfoExtended(),this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":this.state="read"!==this.versionManagementService.getLockType(this.currentVersion)?"lock-none":"lock-read"),s}async undo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.undo(this.currentVersion),{success:!0})}async redo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.redo(this.currentVersion),{success:!0})}async _setUpState(e){await this.versionManagementService.load(e),this.state="lock-none",this.currentVersionInfo=await this.getVersionInfoExtended(),this.versionableItems.forEach(e=>{this.currentVersion?"name"in this.currentVersion?(e.gdbVersion=this.currentVersion.name,e.historicMoment=null):(e.historicMoment=this.currentVersion,e.gdbVersion=null):(e.gdbVersion=null,e.historicMoment=null)}),this.usePersistentReadSessions&&(this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":await this.versionManagementService.startReading(this.currentVersion)&&(this.state="lock-read"))}_isDefaultOrHistoricVersion(e=this.currentVersion){return!(e&&"name"in e)||e.name===this.versionManagementService.defaultVersionIdentifier.name}};e([o()],c.prototype,"versionManagementService",void 0),e([o()],c.prototype,"featureServiceUrl",void 0),e([o()],c.prototype,"url",void 0),e([o()],c.prototype,"currentVersion",void 0),e([o()],c.prototype,"currentVersionInfo",void 0),e([o()],c.prototype,"versionInfos",void 0),e([o()],c.prototype,"versionableItems",void 0),e([o()],c.prototype,"usePersistentReadSessions",void 0),e([o()],c.prototype,"state",void 0),e([o({readOnly:!0})],c.prototype,"defaultVersionIdentifier",null),e([o({readOnly:!0})],c.prototype,"isDefault",null),c=e([a("esri.versionManagement.VersioningState")],c);const u=c;export{u 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{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 has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";const r=256,a=t=>Math.floor(t/256);function n(t){const e=new Set;for(const i of t)e.add(a(i));return e}function c(e,i,h){return e.has(i)||e.set(i,h().then(()=>{e.delete(i)}).catch(h=>{e.delete(i),t(h)})),e.get(i)}const o=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class l{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t
|
|
5
|
+
import has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";const r=256,a=t=>Math.floor(t/256);function n(t){const e=new Set;for(const i of t)e.add(a(i));return e}function c(e,i,h){return e.has(i)||e.set(i,h().then(()=>{e.delete(i)}).catch(h=>{e.delete(i),t(h)})),e.get(i)}const o=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class l{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t,e),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],i=[];for(let r=0;r<t.length;r++){const h=t[r];for(let t=0;t<11;t++){const s=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(h),i.push(s)}}const h={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(i)};this._recordGlyph(h),this._recordGlyph(s)}getTexture(t,e){if(!this._textures[e]){const i=new s(this.width,this.height);i.pixelFormat=6406,i.wrapMode=33071,this._textures[e]=new h(t,i,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,e,i){const h=this._getGlyphCache(t);return await this._fetchRanges(t,e,i),e.map(e=>this._getMosaicItem(h,t,e))}bind(t,e,i,h){const s=this.getTexture(t,i);s.setSamplingMode(e),t.bindTexture(s,h)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const i=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let i=0;i<256;i++)this._getMosaicItem(e,t,i)});return this._preloadCache[t]=i,i}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const h=n(e),s=[];h.forEach(e=>{s.push(this._fetchRange(t,e,i))}),await Promise.all(s)}async _fetchRange(t,e,i){if(e>r)return;const h=t+e;return c(this._rangePromises,h,()=>this._glyphSource.getRange(t,e,i))}_getMosaicItem(t,e,i){if(!t[i]){const h=this._glyphSource.getGlyph(e,i);if(!h?.metrics)return o(i);const s=this._recordGlyph(h),r=this._currentPage,a=h.metrics;t[i]={rect:s,page:r,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const h=t.metrics;let s;if(0===h.width)s=new e(0,0,0,0);else{const e=3,r=h.width+2*e,a=h.height+2*e;s=this._binPack.allocate(r,a),s.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new i(this.width,this.height),s=this._binPack.allocate(r,a));const n=this._glyphData[this._currentPage],c=t.bitmap;let o,l;if(c)for(let t=0;t<a;t++){o=r*t,l=this.width*(s.y+t)+s.x;for(let t=0;t<r;t++)n[l+t]=c[o+t]}has("esri-glyph-debug")&&this._showDebugPage(n)}return s}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),h=new ImageData(this.width,this.height),s=h.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)s[4*r]=t[r],s[4*r+1]=0,s[4*r+2]=0,s[4*r+3]=255;i.putImageData(h,0,0),document.body.appendChild(e)}}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 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};
|
|
@@ -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{unique as e}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{i1616to32 as i}from"../number.js";import{MappedBuffer as r}from"./Buffer.js";import{unpackDataView as s}from"../shaderGraph/techniques/mesh/dataViewUtils.js";import{vertexLayoutHash as f}from"../shaderGraph/techniques/mesh/utils.js";import{PrimitiveType as o,DataType as n}from"../../../../webgl/enums.js";import{VertexArrayObject as u}from"../../../../webgl/VertexArrayObject.js";
|
|
5
|
+
import{unique as e}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{i1616to32 as i}from"../number.js";import{MappedBuffer as r}from"./Buffer.js";import{unpackDataView as s}from"../shaderGraph/techniques/mesh/dataViewUtils.js";import{vertexLayoutHash as f}from"../shaderGraph/techniques/mesh/utils.js";import{PrimitiveType as o,DataType as n}from"../../../../webgl/enums.js";import{VertexArrayObject as u}from"../../../../webgl/VertexArrayObject.js";const a=1e3,h=4,l=[{name:"visibility",offset:0,type:n.FLOAT,count:1}],d={hash:f(l),attributes:l,stride:h};function _(t,i){return e(t.attributes,(e,t)=>e.name===t.name).filter(e=>i.locations.has(e.name)).map(e=>({name:e.name,type:e.type,count:e.count,divisor:0,normalized:e.normalized??!1,offset:e.offset,stride:t.stride})).sort((e,t)=>i.locations.get(e.name)-i.locations.get(t.name))}function m(t,i){const r=[],s=e(t.attributes,(e,t)=>e.name===t.name).filter(e=>i.locations.has(e.name));for(const e of s){r.push({name:e.name,type:e.type,count:e.count,divisor:0,normalized:e.normalized??!1,offset:e.offset,stride:t.stride});const s=i.computeAttributeMap[e.name];null!=s&&2===s.length&&(r.push({name:s[0],count:e.count,divisor:0,type:e.type,normalized:e.normalized??!1,offset:e.offset+t.stride,stride:t.stride}),r.push({name:s[1],count:e.count,divisor:0,type:e.type,normalized:e.normalized??!1,offset:e.offset+2*t.stride,stride:t.stride}))}return r.sort((e,t)=>i.locations.get(e.name)-i.locations.get(t.name))}class c{constructor(e,t,i){if(this._bufferPool=e,this._layout=t,this.useVisibility=i,this._invalidatedGeometry=!1,this._invalidatedCompute=!1,this._position=this._layout.attributes.find(e=>"pos"===e.name||"position"===e.name),!this._position)throw new Error("InternalError: Unable to find position attribute")}destroy(){this._indexBuffer=t(this._indexBuffer),this._vertexBuffer=t(this._vertexBuffer),this._visibilityBuffer=t(this._visibilityBuffer),this._computeVAO?.disposeVAOOnly(),this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(e,t,i,r){return r?{primitive:o.POINTS,count:t/3,offset:i/3}:{primitive:e,count:t,offset:i}}getAttributePrecisionPackFactors(){const e={};for(const t of this.layout.attributes)t.packPrecisionFactor&&(e[t.name]=t.packPrecisionFactor);return e}getDebugVertexInfo(e=!1,t){if(!this._vertexBuffer)return null;const i=this._layout,r=i.stride,f=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),o=[];if(e)if(null==t)console.log("must provide location info to see compute attributes");else for(const s of i.attributes){const e=t.computeAttributeMap[s.name];null!=e&&2===e.length&&(o.push({...s,name:e[0],offset:s.offset+r}),o.push({...s,name:e[1],offset:s.offset+2*r}))}const n=new DataView(f.slice().buffer);let u=f.byteLength/r;e&&(u=this._indexBuffer.fillPointer/3);const a=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let h=0;const l=[];for(let d=0;d<u;d++){if(e){h=a[3*d]*r}const t={};for(const e of[...i.attributes,...o]){let i=`${e.offset} ${e.name}`,r=s(n,e,h);if(e.packPrecisionFactor)if(i+=` (precision: ${e.packPrecisionFactor})`,"number"==typeof r)r/=e.packPrecisionFactor;else for(let t=0;t<r.length;t++)r[t]/=e.packPrecisionFactor;t[i]=r}h+=r,l.push(t)}return{vertices:l,layout:i}}_ensure(e,t){if(this._vertexBuffer&&this._indexBuffer)this._indexBuffer.ensure(Math.max(e,a)),this._vertexBuffer.ensure(Math.max(t,a)),this._visibilityBuffer&&this._visibilityBuffer.ensure(Math.max(t,a));else{const i=this._layout.stride/Uint32Array.BYTES_PER_ELEMENT;this._indexBuffer=new r("index",Math.max(e,a),1,this._bufferPool),this._vertexBuffer=new r("vertex",Math.max(t,a),i,this._bufferPool),this.useVisibility&&(this._visibilityBuffer=new r("vertex",Math.max(t,a),h/Uint32Array.BYTES_PER_ELEMENT,this._bufferPool))}}append(e){const t=e.layout.stride,i=e.indices.byteLength/Uint32Array.BYTES_PER_ELEMENT,r=e.vertices.byteLength/t;this._ensure(i,r);const{vertices:s,indices:f}=e,o=this._vertexBuffer.insert(s,0,s.byteLength/t,0),n=new Uint32Array(r);new Float32Array(n.buffer).fill(255),this._visibilityBuffer&&this._visibilityBuffer.insert(n,0,n.byteLength/h,0);return{vertexFrom:o,indexFrom:this._indexBuffer.insert(f,0,f.byteLength/4,o)}}setEntityRecordRangeVisibility(e,t,i,r){if(!(t+i>e.length))for(let s=t;s<t+i;s++){const{vertexStart:t,vertexCount:i}=e[s];this._visibilityBuffer.setF32Range(t,t+i,r)}}getEntityRecordVisibility(e,t){const i=e.records[t];return this._visibilityBuffer.getF32(i.vertexStart)}copyRecordFrom(e,t,r,s){const{indexStart:f,indexCount:o,vertexStart:n,vertexCount:u}=t;this._ensure(o,u);const a=e._position,h=r*(a.packPrecisionFactor??1),l=s*(a.packPrecisionFactor??1),d=a.offset,_=i(h,l),m=this._vertexBuffer.copyFrom(e._vertexBuffer,n,u,_,d);this._visibilityBuffer&&e._visibilityBuffer&&this._visibilityBuffer.copyFrom(e._visibilityBuffer,n,u,0,0);const c=this._indexBuffer.copyFrom(e._indexBuffer,f,o,m-n,0),y=t.clone();return y.vertexStart=m,y.indexStart=c,y.overlaps=0,y}remove(e,t,i,r){this._indexBuffer.free(e,t),this._vertexBuffer.free(i,r),this._visibilityBuffer&&this._visibilityBuffer.free(i,r)}upload(){this._invalidatedGeometry=!0,this._invalidatedCompute=!0}getGeometryVAO(e,t){if(!this._vertexBuffer||!this._indexBuffer||!this._vertexBuffer.bufferSize)return null;if(this._invalidatedGeometry){if((this._vertexBuffer.invalidated||this._indexBuffer.invalidated||this._visibilityBuffer?.invalidated)&&(this._vertexBuffer.invalidate(),this._indexBuffer.invalidate(),this._visibilityBuffer&&this._visibilityBuffer.invalidate(),this._geometryVAO?.disposeVAOOnly(),this._geometryVAO=null),this._vertexBuffer.upload(),this._indexBuffer.upload(),this._visibilityBuffer&&this._visibilityBuffer.upload(),!this._geometryVAO){const i=this._indexBuffer.getIndexBuffer(e,!1),r=new Map([["geometry",this._vertexBuffer.getVertexBuffer(e,_(this.layout,t))]]);this._visibilityBuffer&&r.set("visibility",this._visibilityBuffer.getVertexBuffer(e,_(d,t))),this._geometryVAO=new u(e,r,i)}this._invalidatedGeometry=!1}return this._geometryVAO}getComputeVAO(e,t){if(!this._vertexBuffer||!this._indexBuffer||!this._vertexBuffer.bufferSize)return null;if(this._invalidatedCompute&&((this._vertexBuffer.invalidated||this._indexBuffer.invalidatedComputeBuffer)&&(this._vertexBuffer.invalidate(),this._indexBuffer.invalidate(),this._visibilityBuffer?.invalidate(),this._computeVAO?.disposeVAOOnly(),this._computeVAO=null),this._vertexBuffer.upload(),this._indexBuffer.upload(),this._visibilityBuffer?.upload(),!this._computeVAO)){const i=this._indexBuffer.getIndexBuffer(e,!0),r=new Map([["geometry",this._vertexBuffer.getVertexBuffer(e,m(this.layout,t))]]);this._visibilityBuffer&&r.set("visibility",this._visibilityBuffer.getVertexBuffer(e,_(d,t))),this._computeVAO=new u(e,r,i),this._invalidatedCompute=!1}return this._computeVAO}get memoryStats(){return{bytesUsed:this._vertexBuffer.memoryStats.bytesUsed+this._indexBuffer.memoryStats.bytesUsed,bytesReserved:this._vertexBuffer.memoryStats.bytesReserved+this._indexBuffer.memoryStats.bytesReserved,vertex:this._vertexBuffer.memoryStats,index:this._indexBuffer.memoryStats}}reshuffle(e){this._vertexBuffer&&this._vertexBuffer.reshuffle(e.vertex.count,e.vertex.operations),this._indexBuffer&&this._indexBuffer.reshuffle(e.index.count,e.index.operations),this._visibilityBuffer&&this._visibilityBuffer.reshuffle(e.vertex.count,e.vertex.operations)}}export{c as MappedMesh};
|
|
@@ -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{textureBindingHighlight0 as r,textureBindingHighlight1 as e}from"../../definitions.js";import{alphaToRgbaChannelSelectorMatrix as s,rgbaToRgbaChannelSelectorMatrix as i,sigma as t}from"./parameters.js";import{highlight as o,blur as u}from"../../shaders/HighlightPrograms.js";import{
|
|
5
|
+
import{textureBindingHighlight0 as r,textureBindingHighlight1 as e}from"../../definitions.js";import{alphaToRgbaChannelSelectorMatrix as s,rgbaToRgbaChannelSelectorMatrix as i,sigma as t}from"./parameters.js";import{highlight as o,blur as u}from"../../shaders/HighlightPrograms.js";import{PrimitiveType as h,DataType as a}from"../../../../../webgl/enums.js";import{createProgram as n}from"../../../../../webgl/ProgramTemplate.js";import{VertexArrayObject as m}from"../../../../../webgl/VertexArrayObject.js";import{VertexBuffer as l}from"../../../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as g}from"../../../../../webgl/VertexElementDescriptor.js";class _{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(e,i){e.bindTexture(i,r),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",s),e.bindVAO(this._resources.quadVAO),e.drawArrays(h.TRIANGLE_STRIP,0,4),e.bindVAO(null)}finalBlur(e,s){e.bindTexture(s,r),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",i),e.bindVAO(this._resources.quadVAO),e.drawArrays(h.TRIANGLE_STRIP,0,4),e.bindVAO(null)}renderHighlight(e,s,i){e.bindTexture(s,r),e.useProgram(this._resources.highlightProgram),i.applyHighlightOptions(e,this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.setBlendingEnabled(!0),e.setBlendFunction(1,771),e.drawArrays(h.TRIANGLE_STRIP,0,4),e.bindVAO(null)}_initialize(s,i,h){this._width=i,this._height=h;const _=new l(s,[new g("a_position",2,a.BYTE,0,4),new g("a_texcoord",2,a.BYTE,2,4)],new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),d=new m(s,_),c=n(s,o,d.locations),f=n(s,u,d.locations);s.useProgram(c),c.setUniform1i("u_texture",r),c.setUniform1i("u_shade",e),c.setUniform1f("u_sigma",t),s.useProgram(f),f.setUniform1i("u_texture",r),f.setUniform1f("u_sigma",t),this._resources={quadGeometry:_,quadVAO:d,highlightProgram:c,blurProgram:f}}setup(r,e,s){this._resources?(this._width=e,this._height=s):this._initialize(r,e,s)}}export{_ 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{toConst as r}from"../../../../../core/compilerUtils.js";import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../webgl/Program.js";import"../../../../../core/has.js";import"../../../../webgl/Renderbuffer.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";import{VertexBuffer as
|
|
5
|
+
import{toConst as r}from"../../../../../core/compilerUtils.js";import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../webgl/Program.js";import"../../../../../core/has.js";import"../../../../webgl/Renderbuffer.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";import{VertexBuffer as i}from"../../../../webgl/VertexBuffer.js";class o{constructor(r,t){this._boundPart=null,this.vertexBuffers=new Map,this.indexBuffers=new Map,this.groups=[];for(const e in t.vertex){const{data:s,layout:o}=t.vertex[e],n=new i(r,o,s);this.vertexBuffers.set(e,n)}for(const s in t.index){const{data:i}=t.index[s],o=e.createIndex(r,35044,i);this.indexBuffers.set(s,o)}for(const e of t.groups)this.groups.push({...e,vertexArrays:new Map});this.parts=t.parts}bind(e,s,i){this._boundPart=i;const{group:o}=this.parts[this._boundPart],n=this.groups[o];if(!n)throw new Error(`Missing group ${o}.`);let f=n.vertexArrays.get(s.stringHash);if(!f){const i=r(new Set(s.locations.keys())),o=n.index?this.indexBuffers.get(n.index):null,a=new Map;for(const[r,e]of this.vertexBuffers){e.layout.filter(r=>i.has(r.name)).length>0&&a.set(r,e)}f=new t(e,a,o),n.vertexArrays.set(s.stringHash,f)}e.bindVAO(f)}draw(r){if(null==this._boundPart)throw new Error("Mesh.bind() has not been called.");const{start:e,count:t}=this.parts[this._boundPart],{group:i}=this.parts[this._boundPart],{primitive:o,index:n}=this.groups[i];if(n){const i=this.indexBuffers.get(n);if(!i)throw new Error(`Missing index buffer "${n}".`);const{indexType:f}=i;if(!f)throw new Error("Buffer type error.");r.drawElements(o,t,f,e*s[f])}else r.drawArrays(o,e,t)}unbind(r){this._boundPart=null,r.bindVAO(null)}destroy(){this.groups.forEach(({vertexArrays:r})=>r.forEach(r=>r.disposeVAOOnly())),this.vertexBuffers.forEach(r=>r.dispose()),this.indexBuffers.forEach(r=>r.dispose())}}export{o as Mesh};
|
|
@@ -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{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as r,PrimitiveType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../webgl/VertexElementDescriptor.js";const o={position:{type:r.SHORT,count:2}};class s extends e{static create(e,r){const i=[];let{stride:o}=r;if(null==o){o=0;for(const[e,{count:i,type:n,offset:s}]of Object.entries(r.layout)){if(null!=s)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");o+=i*t[n]}}let
|
|
5
|
+
import{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as r,PrimitiveType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../webgl/VertexElementDescriptor.js";const o={position:{type:r.SHORT,count:2}};class s extends e{static create(e,r){const i=[];let{stride:o}=r;if(null==o){o=0;for(const[e,{count:i,type:n,offset:s}]of Object.entries(r.layout)){if(null!=s)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");o+=i*t[n]}}let l=0;for(const[s,{count:d,offset:f,type:m,normalized:x}]of Object.entries(r.layout)){null!=f&&(l=f);const e=new n(s,d,m,l,o,null!=x&&x,0);i.push(e),l+=d*t[m]}const a={primitive:r.primitive};null!=r.index&&(a.index="indexData");let{count:u}=r;if(null==u&&(u=r.index?r.index.length:r.vertex.byteLength/o,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${o}.`);const c={start:0,count:u,group:0,primitive:r.primitive},p={vertex:{vertexData:{data:r.vertex,layout:i}},parts:[c],groups:[a]};return null!=r.index&&(p.index={indexData:{data:r.index}}),new s(e,p,r.layout)}static fromVertexStream(t,e){return s.create(t,{primitive:i.TRIANGLE_STRIP,vertex:new Uint16Array(e),layout:o})}constructor(t,e,r){super(t,e),this._spec=r}bind(t,e,r=0){super.bind(t,e,r)}}export{s as SimpleMesh};
|
|
@@ -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{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as i}from"../Technique.js";import{OverlayShader as r}from"../shaders/OverlayShader.js";import{PrimitiveType as
|
|
5
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as i}from"../Technique.js";import{OverlayShader as r}from"../shaders/OverlayShader.js";import{PrimitiveType as o,DataType as n}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as a}from"../../../../../../webgl/VertexElementDescriptor.js";class h extends i{constructor(){super(...arguments),this.type=19,this._mesh=null,this.shaders={overlay:new r}}render(e,t){const{context:i,painter:r}=e,o=this._getMesh(e,t);r.setPipelineState(s);const{isWrapAround:n,wrapAroundShift:a}=t.config,h={...t.config,wrapAroundShift:0},p={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:h},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.setPipelineState({...s,stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},ref:0,mask:255}}}),r.submitDrawMeshUntyped(i,p,o),n&&(h.wrapAroundShift=a,r.submitDrawMeshUntyped(i,p,o))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:i}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(i,{vertex:{positions:{data:s.position,layout:[new a("pos",2,n.FLOAT,0,8)]},uvs:{data:s.tex,layout:[new a("uv",2,n.UNSIGNED_SHORT,0,4)]}},index:null!=s.index?{index:{data:s.index}}:void 0,groups:[{index:null!=s.index?"index":void 0,primitive:o.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{h as OverlayTechnique};
|
package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.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{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{VideoScreenShader as o}from"../shaders/VideoScreenShader.js";import{PrimitiveType as n,DataType as i}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class c extends s{constructor(){super(...arguments),this.type=26,this._mesh=null,this.shaders={geometry:new o}}render(e,t){const{context:s,painter:o}=e,{texture:n,textureCoords:i}=t,m=this._getMesh(e),c=t.ndcRect[2],a=t.ndcRect[3],h=t.ndcRect[0],u=t.ndcRect[1],d=new Float32Array(180);for(let r=0;r<6;r++){const e=a*r/5;for(let t=0;t<6;t++){const s=c*t/5,{u:o,v:n}=i[6*r+t];d[5*(6*r+t)]=h+s,d[5*(6*r+t)+1]=u-e,d[5*(6*r+t)+2]=o,d[5*(6*r+t)+3]=n,d[5*(6*r+t)+4]=1}}m.vertexBuffers.get("geometry")?.
|
|
5
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{VideoScreenShader as o}from"../shaders/VideoScreenShader.js";import{PrimitiveType as n,DataType as i}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class c extends s{constructor(){super(...arguments),this.type=26,this._mesh=null,this.shaders={geometry:new o}}render(e,t){const{context:s,painter:o}=e,{texture:n,textureCoords:i}=t,m=this._getMesh(e),c=t.ndcRect[2],a=t.ndcRect[3],h=t.ndcRect[0],u=t.ndcRect[1],d=new Float32Array(180);for(let r=0;r<6;r++){const e=a*r/5;for(let t=0;t<6;t++){const s=c*t/5,{u:o,v:n}=i[6*r+t];d[5*(6*r+t)]=h+s,d[5*(6*r+t)+1]=u-e,d[5*(6*r+t)+2]=o,d[5*(6*r+t)+3]=n,d[5*(6*r+t)+4]=1}}m.vertexBuffers.get("geometry")?.setData(d);const p={texture:{texture:n,unit:0},opacity:t.opacity},l={shader:this.shaders.geometry,uniforms:{config:p},defines:{},optionalAttributes:null,useComputeBuffer:!1};o.setPipelineState(r),o.submitDrawMeshUntyped(s,l,m)}shutdown(){e(this._mesh)}_getMesh(e){const{context:r}=e,s=new Uint32Array(150);for(let t=0;t<5;t++)for(let e=0;e<5;e++){const r=6*(5*t+e),o=6*(t+1)+e+1,n=o-1,i=o-6,m=o-7;s[r]=o,s[r+1]=n,s[r+2]=i,s[r+3]=n,s[r+4]=m,s[r+5]=i}return this._mesh||(this._mesh=new t(r,{vertex:{geometry:{data:new Float32Array(180),layout:[new m("position",2,i.FLOAT,0,20),new m("texcoord",2,i.FLOAT,8,20),new m("w",1,i.FLOAT,16,20)]}},index:{index:{data:s}},groups:[{primitive:n.TRIANGLES,index:"index"}],parts:[{group:0,start:0,count:s.length}]})),this._mesh}}export{c as VideoScreenTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapContainer as a}from"../engine/BitmapContainer.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import n from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";let h=class extends(m(o(n))){update(t){this._strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new a,this.container.addChild(this._bitmapContainer),this._strategy=new p({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(t,e,r){return this.layer.fetchImageBitmap(t,e,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};t([i()],h.prototype,"_strategy",void 0),
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{BitmapContainer as a}from"../engine/BitmapContainer.js";import{LayerView2DMixin as o}from"./LayerView2D.js";import p from"./support/ExportStrategy.js";import n from"../../layers/LayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";let h=class extends(m(o(n))){update(t){this._strategy.update(t).catch(t=>{r(t)||e.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new a,this.container.addChild(this._bitmapContainer),this._strategy=new p({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(t,e,r){return this.layer.fetchImageBitmap(t,e,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};t([i()],h.prototype,"_strategy",void 0),h=t([s("esri.views.2d.layers.BaseDynamicLayerView2D")],h);const c=h;export{c as default};
|