UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines 1.34 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8457],{38457(e,t,n){n.d(t,{default:()=>s});var a=n(49186),i=n(74887),o=n(83027);class s{constructor(){this._connection=null,this.convertPixelBlockToImageData=async e=>{if(!this._connection)throw new a.A("panoramic-mesh-manager:convertPixelBlockToImageData","Panoramic mesh manager is not loaded");const t=e.clone(),{pixelBlock:n,transferList:i}=t.getTransferableObject();return await this._connection.invoke("convertPixelBlockToImageData",n,{transferList:i})},this.getFacesWithVertexAttributes=async e=>{if(!this._connection)throw new a.A("panoramic-mesh-manager:getFacesWithVertexAttributes","Panoramic mesh manager is not loaded");return await this._connection.invoke("getFacesWithVertexAttributes",e)}}destroy(){this._connection?.close()}async _startWorker(e){this._connection=await(0,o.h)("PanoramicMeshWorker",e)}static getInstance(){return s._instance||(s._instance=new s),s._instance}async load(e){return(0,i.Te)(e),await this._startWorker(e),this}async recomputePositions(e,t,n,i){if(!this._connection)throw new a.A("panoramic-mesh-manager:recomputePositions","Panoramic mesh manager is not loaded");return await this._connection.invoke("recomputePositions",{oldDistance:e,newDistance:t,position:n},{...i,transferList:[n.buffer.slice()]})}}}}]);