define(["./defaultValue-69ee94f4","./Matrix2-671a840a","./Transforms-b2d190a4","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-77f8362f","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./WallGeometryLibrary-cdd7dfc9","./PixelFormat-9ceadbf3","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./arrayRemoveDuplicates-fe254feb","./PolylinePipeline-c0a7a555","./EllipsoidGeodesic-b822d46f","./EllipsoidRhumbLine-7fe7b64a","./IntersectionTests-3c5a408d","./Plane-2cd3a9dd"],(function(e,i,t,n,a,o,s,r,l,m,d,u,c,p,f,h,g,y,_){"use strict";const E=new i.Cartesian3,H=new i.Cartesian3;function b(t){const a=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,s=t.minimumHeights,r=e.defaultValue(t.granularity,n.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=s,this._maximumHeights=o,this._granularity=r,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+a.length*i.Cartesian3.packedLength+2;e.defined(s)&&(m+=s.length),e.defined(o)&&(m+=o.length),this.packedLength=m+i.Ellipsoid.packedLength+1}b.pack=function(t,n,a){let o;a=e.defaultValue(a,0);const s=t._positions;let r=s.length;for(n[a++]=r,o=0;o<r;++o,a+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[o],n,a);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[a++]=r,e.defined(l))for(o=0;o<r;++o)n[a++]=l[o];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[a++]=r,e.defined(m))for(o=0;o<r;++o)n[a++]=m[o];return i.Ellipsoid.pack(t._ellipsoid,n,a),n[a+=i.Ellipsoid.packedLength]=t._granularity,n};const C=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),A={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:C,granularity:void 0};return b.unpack=function(t,n,a){let o;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(o=0;o<s;++o,n+=i.Cartesian3.packedLength)r[o]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),o=0;o<s;++o)l[o]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),o=0;o<s;++o)m[o]=t[n++];const d=i.Ellipsoid.unpack(t,n,C),u=t[n+=i.Ellipsoid.packedLength];return e.defined(a)?(a._positions=r,a._minimumHeights=l,a._maximumHeights=m,a._ellipsoid=i.Ellipsoid.clone(d,a._ellipsoid),a._granularity=u,a):(A.positions=r,A.minimumHeights=l,A.maximumHeights=m,A.granularity=u,new b(A))},b.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,a;const o=i.minimumHeight,s=i.maximumHeight,r=e.defined(o),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,a=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=o),l&&(a[i]=s)}return new b({positions:t,maximumHeights:a,minimumHeights:n,ellipsoid:i.ellipsoid})},b.createGeometry=function(a){const m=a._positions,d=a._minimumHeights,u=a._maximumHeights,c=a._granularity,p=a._ellipsoid,f=l.WallGeometryLibrary.computePositions(p,m,u,d,c,!1);if(!e.defined(f))return;const h=f.bottomPositions,g=f.topPositions;let y=g.length,_=2*y;const b=new Float64Array(_);let C,A=0;for(y/=3,C=0;C<y;++C){const e=3*C,t=i.Cartesian3.fromArray(g,e,E),n=i.Cartesian3.fromArray(h,e,H);b[A++]=n.x,b[A++]=n.y,b[A++]=n.z,b[A++]=t.x,b[A++]=t.y,b[A++]=t.z}const k=new s.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b})}),w=_/3;_=2*w-4+w;const x=r.IndexDatatype.createTypedArray(w,_);let G=0;for(C=0;C<w-2;C+=2){const e=C,t=C+2,a=i.Cartesian3.fromArray(b,3*e,E),o=i.Cartesian3.fromArray(b,3*t,H);if(i.Cartesian3.equalsEpsilon(a,o,n.CesiumMath.EPSILON10))continue;const s=C+1,r=C+3;x[G++]=s,x[G++]=e,x[G++]=s,x[G++]=r,x[G++]=e,x[G++]=t}return x[G++]=w-2,x[G++]=w-1,new o.Geometry({attributes:k,indices:x,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(b)})},function(t,n){return e.defined(n)&&(t=b.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),b.createGeometry(t)}}));
|