define(["exports","./buildModuleUrl-8cce5713","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./when-b60132fc","./PolygonPipeline-f2f37e26","./Math-31e539c2","./Plane-5716a082"],(function(a,t,e,n,r,i,s,o){"use strict";var C=[];function d(a,n){this.center=e.Cartesian3.clone(r.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=t.Matrix3.clone(r.defaultValue(n,t.Matrix3.ZERO)),this.areaDirty=1}C[0]={num:0,des:"inside"},C[1]={num:4,data:[0,4,7,3],des:"left"},C[2]={num:4,data:[1,2,6,5],des:"right"},C[3]={num:0},C[4]={num:4,data:[0,1,5,4],des:"bottom"},C[5]={num:6,data:[0,1,5,4,7,3],des:"bottom, left"},C[6]={num:6,data:[0,1,2,6,5,4],des:"bottom, right"},C[7]={num:0},C[8]={num:4,data:[2,3,7,6],des:"top"},C[9]={num:6,data:[4,7,6,2,3,0],des:"top, left"},C[10]={num:6,data:[2,3,7,6,5,1],des:"top, right"},C[11]={num:0},C[12]={num:0},C[13]={num:0},C[14]={num:0},C[15]={num:0},C[16]={num:4,data:[0,3,2,1],des:"front"},C[17]={num:6,data:[0,4,7,3,2,1],des:"front, left"},C[18]={num:6,data:[0,3,2,6,5,1],des:"front, right"},C[19]={num:0},C[20]={num:6,data:[0,3,2,1,5,4],des:"front, bottom"},C[21]={num:6,data:[2,1,5,4,7,3],des:"front, bottom, left"},C[22]={num:6,data:[0,3,2,6,5,4],des:"front, bottom, right"},C[23]={num:0},C[24]={num:6,data:[0,3,7,6,2,1],des:"front, top"},C[25]={num:6,data:[0,4,7,6,2,1],des:"front, top, left"},C[26]={num:6,data:[0,3,7,6,5,1],des:"front, top, right"},C[27]={num:0},C[28]={num:0},C[29]={num:0},C[30]={num:0},C[31]={num:0},C[32]={num:4,data:[4,5,6,7],des:"back"},C[33]={num:6,data:[4,5,6,7,3,0],des:"back, left"},C[34]={num:6,data:[1,2,6,7,4,5],des:"back, right"},C[35]={num:0},C[36]={num:6,data:[0,1,5,6,7,4],des:"back, bottom"},C[37]={num:6,data:[0,1,5,6,7,3],des:"back, bottom, left"},C[38]={num:6,data:[0,1,2,6,7,4],des:"back, bottom, right"},C[39]={num:0},C[40]={num:6,data:[2,3,7,4,5,6],des:"back, top"},C[41]={num:6,data:[0,4,5,6,2,3],des:"back, top, left"},C[42]={num:6,data:[1,2,3,7,4,5],des:"back, top, right"},d.packedLength=e.Cartesian3.packedLength+t.Matrix3.packedLength,d.pack=function(a,n,i){return i=r.defaultValue(i,0),e.Cartesian3.pack(a.center,n,i),t.Matrix3.pack(a.halfAxes,n,i+e.Cartesian3.packedLength),n},d.unpack=function(a,n,i){return n=r.defaultValue(n,0),r.defined(i)||(i=new d),e.Cartesian3.unpack(a,n,i.center),t.Matrix3.unpack(a,n+e.Cartesian3.packedLength,i.halfAxes),i};var u=new e.Cartesian3,c=new e.Cartesian3,h=new e.Cartesian3,l=new e.Cartesian3,m=new e.Cartesian3,x=new e.Cartesian3,p=new t.Matrix3,M={unitary:new t.Matrix3,diagonal:new t.Matrix3},f=new e.Cartesian3,g=new e.Cartesian3,w=new e.Cartesian3;d.fromPoints=function(a,n){if(r.defined(n)||(n=new d),!r.defined(a)||0===a.length)return n.halfAxes=t.Matrix3.ZERO,n.center=e.Cartesian3.ZERO,n;var i,s=a.length,o=e.Cartesian3.clone(a[0],u);for(i=1;i0?0:f.latitude,J=e.Cartographic.fromRadians(b,a.north,C,z),K=e.Cartographic.fromRadians(a.west,a.north,C,A),Q=e.Cartographic.fromRadians(a.west,y,C,N),$=e.Cartographic.fromRadians(a.west,a.south,C,R),aa=e.Cartographic.fromRadians(b,a.south,C,I),ta=d.cartographicToCartesian(J,T),ea=d.cartographicToCartesian(K,E),na=d.cartographicToCartesian(Q,D),ra=d.cartographicToCartesian($,B),ia=d.cartographicToCartesian(aa,L),sa=w.projectPointToNearestOnPlane(ta,k),oa=w.projectPointToNearestOnPlane(ea,U),Ca=w.projectPointToNearestOnPlane(na,V),da=w.projectPointToNearestOnPlane(ra,S),ua=w.projectPointToNearestOnPlane(ia,_);return h=-(c=Math.min(oa.x,Ca.x,da.x)),m=Math.max(oa.y,sa.y),l=Math.min(da.y,ua.y),K.height=$.height=n,ea=d.cartographicToCartesian(K,E),ra=d.cartographicToCartesian($,B),x=Math.min(o.Plane.getPointDistance(M,ea),o.Plane.getPointDistance(M,ra)),p=C,v(w.origin,w.xAxis,w.yAxis,w.zAxis,c,h,l,m,x,p,u)}var ca=a.south>0,ha=a.north<0,la=ca?a.south:ha?a.north:0,ma=t.Rectangle.center(a,P).longitude,xa=e.Cartesian3.fromRadians(ma,la,C,d,X);xa.z=0;var pa=Math.abs(xa.x)=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};var J=new e.Cartesian3,K=new e.Cartesian3,Q=new e.Cartesian3,$=new e.Cartesian3,aa=new e.Cartesian3;d.distanceSquaredTo=function(a,n){var r=e.Cartesian3.subtract(n,a.center,b),i=a.halfAxes,s=t.Matrix3.getColumn(i,0,J),o=t.Matrix3.getColumn(i,1,K),C=t.Matrix3.getColumn(i,2,Q),d=e.Cartesian3.magnitude(s),u=e.Cartesian3.magnitude(o),c=e.Cartesian3.magnitude(C);e.Cartesian3.normalize(s,s),e.Cartesian3.normalize(o,o),e.Cartesian3.normalize(C,C);var h=$;h.x=e.Cartesian3.dot(r,s),h.y=e.Cartesian3.dot(r,o),h.z=e.Cartesian3.dot(r,C);var l,m=0;return h.x<-d?m+=(l=h.x+d)*l:h.x>d&&(m+=(l=h.x-d)*l),h.y<-u?m+=(l=h.y+u)*l:h.y>u&&(m+=(l=h.y-u)*l),h.z<-c?m+=(l=h.z+c)*l:h.z>c&&(m+=(l=h.z-c)*l),m};var ta=new e.Cartesian3,ea=new e.Cartesian3;d.computePlaneDistances=function(a,n,i,s){r.defined(s)||(s=new t.Interval);var o=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,d=a.center,u=a.halfAxes,c=t.Matrix3.getColumn(u,0,J),h=t.Matrix3.getColumn(u,1,K),l=t.Matrix3.getColumn(u,2,Q),m=e.Cartesian3.add(c,h,ta);e.Cartesian3.add(m,l,m),e.Cartesian3.add(m,d,m);var x=e.Cartesian3.subtract(m,n,ea),p=e.Cartesian3.dot(i,x);return o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.add(d,c,m),e.Cartesian3.add(m,h,m),e.Cartesian3.subtract(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.add(d,c,m),e.Cartesian3.subtract(m,h,m),e.Cartesian3.add(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.add(d,c,m),e.Cartesian3.subtract(m,h,m),e.Cartesian3.subtract(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.subtract(d,c,m),e.Cartesian3.add(m,h,m),e.Cartesian3.add(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.subtract(d,c,m),e.Cartesian3.add(m,h,m),e.Cartesian3.subtract(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.subtract(d,c,m),e.Cartesian3.subtract(m,h,m),e.Cartesian3.add(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),e.Cartesian3.subtract(d,c,m),e.Cartesian3.subtract(m,h,m),e.Cartesian3.subtract(m,l,m),e.Cartesian3.subtract(m,n,x),p=e.Cartesian3.dot(i,x),o=Math.min(p,o),C=Math.max(p,C),s.start=o,s.stop=C,s};var na=new t.BoundingSphere;d.isOccluded=function(a,e){var n=t.BoundingSphere.fromOrientedBoundingBox(a,na);return!e.isBoundingSphereVisible(n)},d.prototype.intersectPlane=function(a){return d.intersectPlane(this,a)},d.prototype.distanceSquaredTo=function(a){return d.distanceSquaredTo(this,a)},d.prototype.computePlaneDistances=function(a,t,e){return d.computePlaneDistances(this,a,t,e)},d.prototype.isOccluded=function(a){return d.isOccluded(this,a)},d.equals=function(a,n){return a===n||r.defined(a)&&r.defined(n)&&e.Cartesian3.equals(a.center,n.center)&&t.Matrix3.equals(a.halfAxes,n.halfAxes)},d.prototype.clone=function(a){return d.clone(this,a)},d.prototype.equals=function(a){return d.equals(this,a)};var ra=new e.Cartesian4;d.prototype._updateBBox=function(){if(1==this.areaDirty){var a=t.Matrix3.getColumn(this.halfAxes,0,J),n=e.Cartesian3.clone(e.Cartesian3.negate(a,f)),r=t.Matrix3.getColumn(this.halfAxes,1,K),i=e.Cartesian3.clone(e.Cartesian3.negate(r,f)),s=t.Matrix3.getColumn(this.halfAxes,2,Q),o=e.Cartesian3.clone(e.Cartesian3.negate(s,f));this.bbox=[],e.Cartesian3.add(this.center,r,f),e.Cartesian3.add(f,o,g),e.Cartesian3.add(g,n,w),this.bbox[0]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(g,a,w),this.bbox[1]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(f,s,g),e.Cartesian3.add(g,a,w),this.bbox[2]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(g,n,w),this.bbox[3]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(this.center,i,f),e.Cartesian3.add(f,o,g),e.Cartesian3.add(g,n,w),this.bbox[4]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(g,a,w),this.bbox[5]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(f,s,g),e.Cartesian3.add(g,a,w),this.bbox[6]=new e.Cartesian3(w.x,w.y,w.z),e.Cartesian3.add(g,n,w),this.bbox[7]=new e.Cartesian3(w.x,w.y,w.z);var C=e.Cartesian3.magnitude(a),d=e.Cartesian3.magnitude(r),u=e.Cartesian3.magnitude(s),c=new e.Cartesian3(-C,-d,-u),h=new e.Cartesian3(C,d,u);if(C*d*u==0)return void(this.areaDirty=-1);e.Cartesian3.normalize(a,a),e.Cartesian3.normalize(r,r),e.Cartesian3.normalize(s,s),this.u=e.Cartesian3.clone(a),this.v=e.Cartesian3.clone(r),this.w=e.Cartesian3.clone(s),this.posMin=c,this.posMaX=h,this.areaDirty=0}};var ia=[];ia.push(new t.Cartesian2),ia.push(new t.Cartesian2),ia.push(new t.Cartesian2),ia.push(new t.Cartesian2),ia.push(new t.Cartesian2),ia.push(new t.Cartesian2);var sa=new e.Cartographic,oa=new e.Cartesian3;d.prototype.calculateBoxArea=function(a,n,o,d,u,c,h,l){this._updateBBox();var m=a,x=e.Cartesian3.subtract(m,this.center,aa);if(-1==this.areaDirty){var p=u/d*(A=-1!=c?c:.5*e.Cartesian3.distance(this.posMaX,this.posMin))/o;return s.Math3D.PI*p*p}var M=e.Cartesian3.fromElements(e.Cartesian3.dot(x,this.u),e.Cartesian3.dot(x,this.v),e.Cartesian3.dot(x,this.w),ta),f=(M.xthis.posMaX.x?1:0)<<1)+((M.zthis.posMaX.z?1:0)<<3)+((M.y>this.posMaX.y?1:0)<<4)+((M.y42)return console.log("area calculation is wrong"),-100;var g=C[f];if(0==g.num){p=u/d*(A=-1!=c?c:.5*e.Cartesian3.distance(this.posMaX,this.posMin))/o;return s.Math3D.PI*p*p}if(0==g.num)return console.log("area calculation is wrong"),-100;for(var w,b=[],y=h,v=0;v