define(["./when-e3a49219","./Matrix2-ae0e0b05","./arrayRemoveDuplicates-328bac4c","./BoundingRectangle-61e59108","./Transforms-a6362ad2","./ComponentDatatype-64cf6611","./PolylineVolumeGeometryLibrary-1ff78bc3","./RuntimeError-ffc802eb","./GeometryAttribute-50aef525","./GeometryAttributes-3db3f2c9","./IndexDatatype-e12e2493","./PolygonPipeline-2bbe6eb1","./PixelFormat-83d70a69","./WebGLConstants-1c8239cc","./combine-c7a1ec8a","./EllipsoidTangentPlane-e3af9e65","./AxisAlignedBoundingBox-699685f5","./IntersectionTests-8be403d7","./Plane-2bf1bb80","./PolylinePipeline-e16881a5","./EllipsoidGeodesic-524df442","./EllipsoidRhumbLine-b6518e5c"],(function(e,i,n,t,a,r,o,l,s,p,d,c,u,y,g,h,f,m,v,E,b,P){"use strict";function _(n){var t=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,a=n.shapePositions;this._positions=t,this._shape=a,this._ellipsoid=i.Ellipsoid.clone(e.defaultValue(n.ellipsoid,i.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,o.CornerType.ROUNDED),this._granularity=e.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var l=1+t.length*i.Cartesian3.packedLength;l+=1+a.length*i.Cartesian2.packedLength,this.packedLength=l+i.Ellipsoid.packedLength+2}_.pack=function(n,t,a){var r;a=e.defaultValue(a,0);var o=n._positions,l=o.length;for(t[a++]=l,r=0;r<l;++r,a+=i.Cartesian3.packedLength)i.Cartesian3.pack(o[r],t,a);var s=n._shape;for(l=s.length,t[a++]=l,r=0;r<l;++r,a+=i.Cartesian2.packedLength)i.Cartesian2.pack(s[r],t,a);return i.Ellipsoid.pack(n._ellipsoid,t,a),a+=i.Ellipsoid.packedLength,t[a++]=n._cornerType,t[a]=n._granularity,t};var k=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),C={polylinePositions:void 0,shapePositions:void 0,ellipsoid:k,height:void 0,cornerType:void 0,granularity:void 0};_.unpack=function(n,t,a){var r;t=e.defaultValue(t,0);var o=n[t++],l=new Array(o);for(r=0;r<o;++r,t+=i.Cartesian3.packedLength)l[r]=i.Cartesian3.unpack(n,t);o=n[t++];var s=new Array(o);for(r=0;r<o;++r,t+=i.Cartesian2.packedLength)s[r]=i.Cartesian2.unpack(n,t);var p=i.Ellipsoid.unpack(n,t,k);t+=i.Ellipsoid.packedLength;var d=n[t++],c=n[t];return e.defined(a)?(a._positions=l,a._shape=s,a._ellipsoid=i.Ellipsoid.clone(p,a._ellipsoid),a._cornerType=d,a._granularity=c,a):(C.polylinePositions=l,C.shapePositions=s,C.cornerType=d,C.granularity=c,new _(C))};var L=new t.BoundingRectangle;return _.createGeometry=function(e){var l=e._positions,u=n.arrayRemoveDuplicates(l,i.Cartesian3.equalsEpsilon),y=e._shape;if(y=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),!(u.length<2||y.length<3)){c.PolygonPipeline.computeWindingOrder2D(y)===c.WindingOrder.CLOCKWISE&&y.reverse();var g=t.BoundingRectangle.fromPoints(y,L);return function(e,i){var n=new p.GeometryAttributes;n.position=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var t,o,l=i.length,c=n.position.values.length/3,u=e.length/3/l,y=d.IndexDatatype.createTypedArray(c,2*l*(u+1)),g=0,h=(t=0)*l;for(o=0;o<l-1;o++)y[g++]=o+h,y[g++]=o+h+1;for(y[g++]=l-1+h,y[g++]=h,h=(t=u-1)*l,o=0;o<l-1;o++)y[g++]=o+h,y[g++]=o+h+1;for(y[g++]=l-1+h,y[g++]=h,t=0;t<u-1;t++){var f=l*t,m=f+l;for(o=0;o<l;o++)y[g++]=o+f,y[g++]=o+m}return new s.Geometry({attributes:n,indices:d.IndexDatatype.createTypedArray(c,y),boundingSphere:a.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES})}(o.PolylineVolumeGeometryLibrary.computePositions(u,y,g,e,!1),y)}},function(n,t){return e.defined(t)&&(n=_.unpack(n,t)),n._ellipsoid=i.Ellipsoid.clone(n._ellipsoid),_.createGeometry(n)}}));
|