| 1 |
- define(["./when-b60132fc","./Cartesian2-47311507","./ArcType-29cf2197","./buildModuleUrl-57a32107","./Cartographic-3309dd0d","./Color-5008547b","./ComponentDatatype-c140a87d","./Check-7b2a090c","./GeometryAttribute-c42d25b7","./GeometryAttributes-252e9929","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolylinePipeline-4ec7a59e","./Matrix4-cde86d0e","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./FeatureDetection-c3b71206","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./IntersectionTests-5e35c2ab","./Plane-ca0357f4"],(function(e,o,r,t,a,l,i,n,s,p,d,c,y,u,f,h,C,g,T,m,v,b){"use strict";function P(e,o,r,t,a,i,n){var s,p=y.PolylinePipeline.numberOfPoints(e,o,a),d=r.red,c=r.green,u=r.blue,f=r.alpha,h=t.red,C=t.green,g=t.blue,T=t.alpha;if(l.Color.equals(r,t)){for(s=0;s<p;s++)i[n++]=l.Color.floatToByte(d),i[n++]=l.Color.floatToByte(c),i[n++]=l.Color.floatToByte(u),i[n++]=l.Color.floatToByte(f);return n}var m=(h-d)/p,v=(C-c)/p,b=(g-u)/p,P=(T-f)/p,_=n;for(s=0;s<p;s++)i[_++]=l.Color.floatToByte(d+s*m),i[_++]=l.Color.floatToByte(c+s*v),i[_++]=l.Color.floatToByte(u+s*b),i[_++]=l.Color.floatToByte(f+s*P);return _}function _(t){var i=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,n=t.colors,s=e.defaultValue(t.colorsPerVertex,!1);this._positions=i,this._colors=n,this._colorsPerVertex=s,this._arcType=e.defaultValue(t.arcType,r.ArcType.GEODESIC),this._granularity=e.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(t.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";var p=1+i.length*a.Cartesian3.packedLength;p+=e.defined(n)?1+n.length*l.Color.packedLength:1,this.packedLength=p+o.Ellipsoid.packedLength+3}_.pack=function(r,t,i){var n;i=e.defaultValue(i,0);var s=r._positions,p=s.length;for(t[i++]=p,n=0;n<p;++n,i+=a.Cartesian3.packedLength)a.Cartesian3.pack(s[n],t,i);var d=r._colors;for(p=e.defined(d)?d.length:0,t[i++]=p,n=0;n<p;++n,i+=l.Color.packedLength)l.Color.pack(d[n],t,i);return o.Ellipsoid.pack(r._ellipsoid,t,i),i+=o.Ellipsoid.packedLength,t[i++]=r._colorsPerVertex?1:0,t[i++]=r._arcType,t[i]=r._granularity,t},_.unpack=function(r,t,i){var n;t=e.defaultValue(t,0);var s=r[t++],p=new Array(s);for(n=0;n<s;++n,t+=a.Cartesian3.packedLength)p[n]=a.Cartesian3.unpack(r,t);var d=(s=r[t++])>0?new Array(s):void 0;for(n=0;n<s;++n,t+=l.Color.packedLength)d[n]=l.Color.unpack(r,t);var c=o.Ellipsoid.unpack(r,t);t+=o.Ellipsoid.packedLength;var y=1===r[t++],u=r[t++],f=r[t];return e.defined(i)?(i._positions=p,i._colors=d,i._ellipsoid=c,i._colorsPerVertex=y,i._arcType=u,i._granularity=f,i):new _({positions:p,colors:d,ellipsoid:c,colorsPerVertex:y,arcType:u,granularity:f})};var B=new Array(2),A=new Array(2),E={positions:B,height:A,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return _.createGeometry=function(o){var n,u,f,h,C,g=o._positions,T=o._colors,m=o._colorsPerVertex,v=o._arcType,b=o._granularity,_=o._ellipsoid,k=c.CesiumMath.chordLength(b,_.maximumRadius),D=e.defined(T)&&!m,G=g.length,w=0;if(v===r.ArcType.GEODESIC||v===r.ArcType.RHUMB){var L,V,x;v===r.ArcType.GEODESIC?(L=c.CesiumMath.chordLength(b,_.maximumRadius),V=y.PolylinePipeline.numberOfPoints,x=y.PolylinePipeline.generateArc):(L=b,V=y.PolylinePipeline.numberOfPointsRhumbLine,x=y.PolylinePipeline.generateRhumbArc);var S=y.PolylinePipeline.extractHeights(g,_),I=E;if(v===r.ArcType.GEODESIC?I.minDistance=k:I.granularity=b,I.ellipsoid=_,D){var R=0;for(n=0;n<G-1;n++)R+=V(g[n],g[n+1],L)+1;u=new Float64Array(3*R),h=new Uint8Array(4*R),I.positions=B,I.height=A;var O=0;for(n=0;n<G-1;++n){B[0]=g[n],B[1]=g[n+1],A[0]=S[n],A[1]=S[n+1];var M=x(I);if(e.defined(T)){var U=M.length/3;C=T[n];for(var N=0;N<U;++N)h[O++]=l.Color.floatToByte(C.red),h[O++]=l.Color.floatToByte(C.green),h[O++]=l.Color.floatToByte(C.blue),h[O++]=l.Color.floatToByte(C.alpha)}u.set(M,w),w+=M.length}}else if(I.positions=g,I.height=S,u=new Float64Array(x(I)),e.defined(T)){for(h=new Uint8Array(u.length/3*4),n=0;n<G-1;++n){w=P(g[n],g[n+1],T[n],T[n+1],k,h,w)}var F=T[G-1];h[w++]=l.Color.floatToByte(F.red),h[w++]=l.Color.floatToByte(F.green),h[w++]=l.Color.floatToByte(F.blue),h[w++]=l.Color.floatToByte(F.alpha)}}else{f=D?2*G-2:G,u=new Float64Array(3*f),h=e.defined(T)?new Uint8Array(4*f):void 0;var H=0,W=0;for(n=0;n<G;++n){var Y=g[n];if(D&&n>0&&(a.Cartesian3.pack(Y,u,H),H+=3,C=T[n-1],h[W++]=l.Color.floatToByte(C.red),h[W++]=l.Color.floatToByte(C.green),h[W++]=l.Color.floatToByte(C.blue),h[W++]=l.Color.floatToByte(C.alpha)),D&&n===G-1)break;a.Cartesian3.pack(Y,u,H),H+=3,e.defined(T)&&(C=T[n],h[W++]=l.Color.floatToByte(C.red),h[W++]=l.Color.floatToByte(C.green),h[W++]=l.Color.floatToByte(C.blue),h[W++]=l.Color.floatToByte(C.alpha))}}var q=new p.GeometryAttributes;q.position=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),e.defined(T)&&(q.color=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:h,normalize:!0}));var z=2*((f=u.length/3)-1),J=d.IndexDatatype.createTypedArray(f,z),j=0;for(n=0;n<f-1;++n)J[j++]=n,J[j++]=n+1;return new s.Geometry({attributes:q,indices:J,primitiveType:t.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromPoints(g)})},function(r,t){return e.defined(t)&&(r=_.unpack(r,t)),r._ellipsoid=o.Ellipsoid.clone(r._ellipsoid),_.createGeometry(r)}}));
|