define(["./when-77f4e3be","./Check-d71f548f","./Math-b81aa1f1","./Cartesian2-69a87134","./Transforms-03dbcaf7","./RuntimeError-34dd6124","./WebGLConstants-3e40d443","./ComponentDatatype-af4852df","./GeometryAttribute-d15db730","./GeometryAttributes-0175f743","./IndexDatatype-41885adf","./IntersectionTests-ad3a0195","./Plane-a18bfa39","./arrayRemoveDuplicates-64383b1a","./BoundingRectangle-ea4a050c","./EllipsoidTangentPlane-5dd5582e","./EllipsoidRhumbLine-28fc0dda","./PolygonPipeline-9a882b7c","./PolylineVolumeGeometryLibrary-c9b0c248","./EllipsoidGeodesic-be0f0da9","./PolylinePipeline-8cf4403e"],function(d,e,t,u,y,i,a,h,f,g,m,n,r,o,l,s,p,c,v,E,P){"use strict";function _(e){var i=(e=d.defaultValue(e,d.defaultValue.EMPTY_OBJECT)).polylinePositions,a=e.shapePositions;this._positions=i,this._shape=a,this._ellipsoid=u.Ellipsoid.clone(d.defaultValue(e.ellipsoid,u.Ellipsoid.WGS84)),this._cornerType=d.defaultValue(e.cornerType,v.CornerType.ROUNDED),this._granularity=d.defaultValue(e.granularity,t.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var n=1+i.length*u.Cartesian3.packedLength;n+=1+a.length*u.Cartesian2.packedLength,this.packedLength=n+u.Ellipsoid.packedLength+2}_.pack=function(e,i,a){var n;a=d.defaultValue(a,0);var t=e._positions,r=t.length;for(i[a++]=r,n=0;n<r;++n,a+=u.Cartesian3.packedLength)u.Cartesian3.pack(t[n],i,a);var o=e._shape;for(r=o.length,i[a++]=r,n=0;n<r;++n,a+=u.Cartesian2.packedLength)u.Cartesian2.pack(o[n],i,a);return u.Ellipsoid.pack(e._ellipsoid,i,a),a+=u.Ellipsoid.packedLength,i[a++]=e._cornerType,i[a]=e._granularity,i};var b=u.Ellipsoid.clone(u.Ellipsoid.UNIT_SPHERE),k={polylinePositions:void 0,shapePositions:void 0,ellipsoid:b,height:void 0,cornerType:void 0,granularity:void 0};_.unpack=function(e,i,a){var n;i=d.defaultValue(i,0);var t=e[i++],r=new Array(t);for(n=0;n<t;++n,i+=u.Cartesian3.packedLength)r[n]=u.Cartesian3.unpack(e,i);t=e[i++];var o=new Array(t);for(n=0;n<t;++n,i+=u.Cartesian2.packedLength)o[n]=u.Cartesian2.unpack(e,i);var l=u.Ellipsoid.unpack(e,i,b);i+=u.Ellipsoid.packedLength;var s=e[i++],p=e[i];return d.defined(a)?(a._positions=r,a._shape=o,a._ellipsoid=u.Ellipsoid.clone(l,a._ellipsoid),a._cornerType=s,a._granularity=p,a):(k.polylinePositions=r,k.shapePositions=o,k.cornerType=s,k.granularity=p,new _(k))};var C=new l.BoundingRectangle;return _.createGeometry=function(e){var i=e._positions,a=o.arrayRemoveDuplicates(i,u.Cartesian3.equalsEpsilon),n=e._shape;if(n=v.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(n),!(a.length<2||n.length<3)){c.PolygonPipeline.computeWindingOrder2D(n)===c.WindingOrder.CLOCKWISE&&n.reverse();var t=l.BoundingRectangle.fromPoints(n,C);return function(e,i){var a=new g.GeometryAttributes;a.position=new f.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var n,t,r=i.length,o=a.position.values.length/3,l=e.length/3/r,s=m.IndexDatatype.createTypedArray(o,2*r*(1+l)),p=0,d=(n=0)*r;for(t=0;t<r-1;t++)s[p++]=t+d,s[p++]=t+d+1;for(s[p++]=r-1+d,s[p++]=d,d=(n=l-1)*r,t=0;t<r-1;t++)s[p++]=t+d,s[p++]=t+d+1;for(s[p++]=r-1+d,s[p++]=d,n=0;n<l-1;n++){var u=r*n,c=u+r;for(t=0;t<r;t++)s[p++]=t+u,s[p++]=t+c}return new f.Geometry({attributes:a,indices:m.IndexDatatype.createTypedArray(o,s),boundingSphere:y.BoundingSphere.fromVertices(e),primitiveType:f.PrimitiveType.LINES})}(v.PolylineVolumeGeometryLibrary.computePositions(a,n,t,e,!1),n)}},function(e,i){return d.defined(i)&&(e=_.unpack(e,i)),e._ellipsoid=u.Ellipsoid.clone(e._ellipsoid),_.createGeometry(e)}});
|