/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";import{a as i}from"../../../../chunks/PointRenderer.glsl.js";class h extends i{constructor(t,i,h,e,s,l,r,n,g=null){super(h,s,i),this.id=t,this.obb=e,this.coordinates=l,this.rgb=r,this.attributes=n,this.pointIdFilterMap=g,this.highlightMap=new Map,this.resolvedHighlightRanges=new Map}addHighlight(i,h){const{highlightMap:e}=this;t(e,h.highlightName,()=>new Array).push(new s(i,h))}removeHighlight(t){const{highlightMap:i}=this,{highlightName:h}=t,e=i.get(h);if(!e)return;const s=e.filter(i=>i.id!==t);0===s.length?i.delete(h):i.set(h,s)}clearHighlights(){this.highlightMap.clear(),this.resolvedHighlightRanges.clear()}updateResolvedHighlights(i){if(this.resolvedHighlightRanges.clear(),0===this.highlightMap.size||0===i.length)return;const h=this.coordinates.length/3,e=new Array(h);for(const{name:t}of i){const i=this.highlightMap.get(t);if(i&&0!==i.length)for(const{pointId:h}of i)e[h]=t}let s=null,l=-1;const r=i=>{if(null==s||l<0)return;t(this.resolvedHighlightRanges,s,()=>[]).push(l,i-l)};for(let t=0;t<h;++t){const i=e[t];i!==s&&(r(t),s=i,l=null==i?-1:t)}r(h)}get usedMemory(){return 5*this.coordinates.length+128}}function e(t){return t.hasOwnProperty("splatSize")}class s{constructor(t,i){this.pointId=t,this.id=i}}export{h as PointCloudRendererNode,e as isPointRendererNode};
