/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../geometry/support/aaBoundingRect"],(function(i,e){"use strict";let t=function(){function t(t,s,n,l=null){this.lij=[0,0,0],this.extent=e.create(),this.resolution=0,this.loadPriority=0,this.measures={visibility:i.Visibility.VISIBLE_ON_SURFACE,screenRect:e.create(),distance:0,shouldSplit:!1},this.used=!1,l&&this.acquire(t,s,n,l)}var s=t.prototype;return s.acquire=function(i,e,s,n){this.tilingScheme=n,this.id=t.id(i,e,s),this.lij[0]=i,this.lij[1]=e,this.lij[2]=s,n.getExtent(i,e,s,this.extent),this.resolution=n.resolutionAtLevel(i)},s.release=function(){this.tilingScheme=null},s.getChildren=function(i){const e=this.lij[0]+1,s=2*this.lij[1],n=2*this.lij[2];return i?(i[0].acquire(e,s,n,this.tilingScheme),i[1].acquire(e,s+1,n,this.tilingScheme),i[2].acquire(e,s,n+1,this.tilingScheme),i[3].acquire(e,s+1,n+1,this.tilingScheme),i):[new t(e,s,n,this.tilingScheme),new t(e,s+1,n,this.tilingScheme),new t(e,s,n+1,this.tilingScheme),new t(e,s+1,n+1,this.tilingScheme)]},s.copyMeasurementsFrom=function(i){this.measures.visibility=i.measures.visibility,this.measures.shouldSplit=i.measures.shouldSplit,this.measures.distance=i.measures.distance,e.copy(i.measures.screenRect,this.measures.screenRect)},t.id=function(i,e,t){return`${i}/${e}/${t}`},t}();var s;i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.INVISIBLE=0]="INVISIBLE",s[s.VISIBLE_WHEN_EXTENDED=1]="VISIBLE_WHEN_EXTENDED",s[s.VISIBLE_ON_SURFACE=2]="VISIBLE_ON_SURFACE",i.FeatureTileDescriptor3D=t,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
