define(["./defaultValue-69ee94f4","./Matrix2-671a840a","./ArcType-e1641d8d","./Transforms-b2d190a4","./Color-4d276594","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-77f8362f","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolylinePipeline-c0a7a555","./PixelFormat-9ceadbf3","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipsoidGeodesic-b822d46f","./EllipsoidRhumbLine-7fe7b64a","./IntersectionTests-3c5a408d","./Plane-2cd3a9dd"],(function(e,o,t,l,r,n,a,i,s,c,p,d,f,y,u,h,C,m,T){"use strict";function g(e,o,t,l,n,a,i){const s=p.PolylinePipeline.numberOfPoints(e,o,n);let c;const d=t.red,f=t.green,y=t.blue,u=t.alpha,h=l.red,C=l.green,m=l.blue,T=l.alpha;if(r.Color.equals(t,l)){for(c=0;c<s;c++)a[i++]=r.Color.floatToByte(d),a[i++]=r.Color.floatToByte(f),a[i++]=r.Color.floatToByte(y),a[i++]=r.Color.floatToByte(u);return i}const g=(h-d)/s,P=(C-f)/s,_=(m-y)/s,b=(T-u)/s;let B=i;for(c=0;c<s;c++)a[B++]=r.Color.floatToByte(d+c*g),a[B++]=r.Color.floatToByte(f+c*P),a[B++]=r.Color.floatToByte(y+c*_),a[B++]=r.Color.floatToByte(u+c*b);return B}function P(l){const a=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,i=l.colors,s=e.defaultValue(l.colorsPerVertex,!1);this._positions=a,this._colors=i,this._colorsPerVertex=s,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let c=1+a.length*o.Cartesian3.packedLength;c+=e.defined(i)?1+i.length*r.Color.packedLength:1,this.packedLength=c+o.Ellipsoid.packedLength+3}P.pack=function(t,l,n){let a;n=e.defaultValue(n,0);const i=t._positions;let s=i.length;for(l[n++]=s,a=0;a<s;++a,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(i[a],l,n);const c=t._colors;for(s=e.defined(c)?c.length:0,l[n++]=s,a=0;a<s;++a,n+=r.Color.packedLength)r.Color.pack(c[a],l,n);return o.Ellipsoid.pack(t._ellipsoid,l,n),n+=o.Ellipsoid.packedLength,l[n++]=t._colorsPerVertex?1:0,l[n++]=t._arcType,l[n]=t._granularity,l},P.unpack=function(t,l,n){let a;l=e.defaultValue(l,0);let i=t[l++];const s=new Array(i);for(a=0;a<i;++a,l+=o.Cartesian3.packedLength)s[a]=o.Cartesian3.unpack(t,l);i=t[l++];const c=i>0?new Array(i):void 0;for(a=0;a<i;++a,l+=r.Color.packedLength)c[a]=r.Color.unpack(t,l);const p=o.Ellipsoid.unpack(t,l);l+=o.Ellipsoid.packedLength;const d=1===t[l++],f=t[l++],y=t[l];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=p,n._colorsPerVertex=d,n._arcType=f,n._granularity=y,n):new P({positions:s,colors:c,ellipsoid:p,colorsPerVertex:d,arcType:f,granularity:y})};const _=new Array(2),b=new Array(2),B={positions:_,height:b,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return P.createGeometry=function(a){const d=a._positions,f=a._colors,y=a._colorsPerVertex,u=a._arcType,h=a._granularity,C=a._ellipsoid,m=n.CesiumMath.chordLength(h,C.maximumRadius),T=e.defined(f)&&!y;let P;const A=d.length;let E,k,G,D,L=0;if(u===t.ArcType.GEODESIC||u===t.ArcType.RHUMB){let o,l,a;u===t.ArcType.GEODESIC?(o=n.CesiumMath.chordLength(h,C.maximumRadius),l=p.PolylinePipeline.numberOfPoints,a=p.PolylinePipeline.generateArc):(o=h,l=p.PolylinePipeline.numberOfPointsRhumbLine,a=p.PolylinePipeline.generateRhumbArc);const i=p.PolylinePipeline.extractHeights(d,C),s=B;if(u===t.ArcType.GEODESIC?s.minDistance=m:s.granularity=h,s.ellipsoid=C,T){let t=0;for(P=0;P<A-1;P++)t+=l(d[P],d[P+1],o)+1;E=new Float64Array(3*t),G=new Uint8Array(4*t),s.positions=_,s.height=b;let n=0;for(P=0;P<A-1;++P){_[0]=d[P],_[1]=d[P+1],b[0]=i[P],b[1]=i[P+1];const o=a(s);if(e.defined(f)){const e=o.length/3;D=f[P];for(let o=0;o<e;++o)G[n++]=r.Color.floatToByte(D.red),G[n++]=r.Color.floatToByte(D.green),G[n++]=r.Color.floatToByte(D.blue),G[n++]=r.Color.floatToByte(D.alpha)}E.set(o,L),L+=o.length}}else if(s.positions=d,s.height=i,E=new Float64Array(a(s)),e.defined(f)){for(G=new Uint8Array(E.length/3*4),P=0;P<A-1;++P){L=g(d[P],d[P+1],f[P],f[P+1],m,G,L)}const e=f[A-1];G[L++]=r.Color.floatToByte(e.red),G[L++]=r.Color.floatToByte(e.green),G[L++]=r.Color.floatToByte(e.blue),G[L++]=r.Color.floatToByte(e.alpha)}}else{k=T?2*A-2:A,E=new Float64Array(3*k),G=e.defined(f)?new Uint8Array(4*k):void 0;let t=0,l=0;for(P=0;P<A;++P){const n=d[P];if(T&&P>0&&(o.Cartesian3.pack(n,E,t),t+=3,D=f[P-1],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha)),T&&P===A-1)break;o.Cartesian3.pack(n,E,t),t+=3,e.defined(f)&&(D=f[P],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha))}}const w=new s.GeometryAttributes;w.position=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:E}),e.defined(f)&&(w.color=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0})),k=E.length/3;const V=2*(k-1),x=c.IndexDatatype.createTypedArray(k,V);let S=0;for(P=0;P<k-1;++P)x[S++]=P,x[S++]=P+1;return new i.Geometry({attributes:w,indices:x,primitiveType:i.PrimitiveType.LINES,boundingSphere:l.BoundingSphere.fromPoints(d)})},function(t,l){return e.defined(l)&&(t=P.unpack(t,l)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),P.createGeometry(t)}}));
|