/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import e from"./BaseBucket.js";class t extends e{constructor(e,t,r,i,c){super(e,t,r),this.type=4,this._circleVertexBuffer=i,this._circleIndexBuffer=c}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,r=this._circleIndexBuffer;this._circleIndexStart=3*r.index,this._circleIndexCount=0;const i=this.layer,c=this.zoom;e&&e.setExtent(this.layerExtent);for(const s of this._features){const n=s.getGeometry(e);if(!n)continue;const l=i.circleMaterial.encodeAttributes(s,c,i);for(const e of n)if(e)for(const i of e){const e=t.index;t.add(i.x,i.y,0,0,l),t.add(i.x,i.y,0,1,l),t.add(i.x,i.y,1,0,l),t.add(i.x,i.y,1,1,l),r.add(e,e+1,e+2),r.add(e+1,e+2,e+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let c=0;c<this.layerUIDs.length;c++)t[i++]=this.layerUIDs[c];t[i++]=this._circleIndexStart,t[i++]=this._circleIndexCount,t[i++]=this._circleVertexBuffer.array.length;for(let c=0;c<this._circleVertexBuffer.array.length;c++)r[i++]=this._circleVertexBuffer.array[c];t[i++]=this._circleIndexBuffer.array.length;for(let c=0;c<this._circleIndexBuffer.array.length;c++)t[i++]=this._circleIndexBuffer.array[c];return t.buffer}}export{t as default};
