integrated_traffic_vue/public/lib/Cesium/Workers/createSimplePolylineGeometr...

2 lines
5.3 KiB
JavaScript
Raw Normal View History

2024-01-31 09:03:02 +08:00
define(["./defaultValue-0a909f67","./Matrix3-b6f074fa","./ArcType-ce2e50ab","./Transforms-713aa3a8","./Color-27beebda","./ComponentDatatype-77274976","./GeometryAttribute-0b8b7b82","./GeometryAttributes-f06a2792","./IndexDatatype-2149f06c","./Math-e97915da","./PolylinePipeline-22c11203","./Matrix2-163b5a1d","./RuntimeError-06c93819","./combine-ca22a614","./WebGLConstants-a8cc3e8c","./EllipsoidGeodesic-b00a0416","./EllipsoidRhumbLine-7f84cca0","./IntersectionTests-87baf287","./Plane-1c5a21a3"],(function(e,o,t,l,r,n,a,i,s,c,p,d,y,f,u,h,C,T,g){"use strict";function m(e,o,t,l,n,a,i){const s=p.PolylinePipeline.numberOfPoints(e,o,n);let c;const d=t.red,y=t.green,f=t.blue,u=t.alpha,h=l.red,C=l.green,T=l.blue,g=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(y),a[i++]=r.Color.floatToByte(f),a[i++]=r.Color.floatToByte(u);return i}const m=(h-d)/s,b=(C-y)/s,P=(T-f)/s,_=(g-u)/s;let B=i;for(c=0;c<s;c++)a[B++]=r.Color.floatToByte(d+c*m),a[B++]=r.Color.floatToByte(y+c*b),a[B++]=r.Color.floatToByte(f+c*P),a[B++]=r.Color.floatToByte(u+c*_);return B}function b(l){const n=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,a=l.colors,i=e.defaultValue(l.colorsPerVertex,!1);this._positions=n,this._colors=a,this._colorsPerVertex=i,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,c.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let s=1+n.length*o.Cartesian3.packedLength;s+=e.defined(a)?1+a.length*r.Color.packedLength:1,this.packedLength=s+o.Ellipsoid.packedLength+3}b.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},b.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++],y=t[l++],f=t[l];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=p,n._colorsPerVertex=d,n._arcType=y,n._granularity=f,n):new b({positions:s,colors:c,ellipsoid:p,colorsPerVertex:d,arcType:y,granularity:f})};const P=new Array(2),_=new Array(2),B={positions:P,height:_,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return b.createGeometry=function(d){const y=d._positions,f=d._colors,u=d._colorsPerVertex,h=d._arcType,C=d._granularity,T=d._ellipsoid,g=c.CesiumMath.chordLength(C,T.maximumRadius),b=e.defined(f)&&!u;let A;const E=y.length;let k,G,D,L,w=0;if(h===t.ArcType.GEODESIC||h===t.ArcType.RHUMB){let o,l,n;h===t.ArcType.GEODESIC?(o=c.CesiumMath.chordLength(C,T.maximumRadius),l=p.PolylinePipeline.numberOfPoints,n=p.PolylinePipeline.generateArc):(o=C,l=p.PolylinePipeline.numberOfPointsRhumbLine,n=p.PolylinePipeline.generateRhumbArc);const a=p.PolylinePipeline.extractHeights(y,T),i=B;if(h===t.ArcType.GEODESIC?i.minDistance=g:i.granularity=C,i.ellipsoid=T,b){let t=0;for(A=0;A<E-1;A++)t+=l(y[A],y[A+1],o)+1;k=new Float64Array(3*t),D=new Uint8Array(4*t),i.positions=P,i.height=_;let s=0;for(A=0;A<E-1;++A){P[0]=y[A],P[1]=y[A+1],_[0]=a[A],_[1]=a[A+1];const o=n(i);if(e.defined(f)){const e=o.length/3;L=f[A];for(let o=0;o<e;++o)D[s++]=r.Color.floatToByte(L.red),D[s++]=r.Color.floatToByte(L.green),D[s++]=r.Color.floatToByte(L.blue),D[s++]=r.Color.floatToByte(L.alpha)}k.set(o,w),w+=o.length}}else if(i.positions=y,i.height=a,k=new Float64Array(n(i)),e.defined(f)){for(D=new Uint8Array(k.length/3*4),A=0;A<E-1;++A){w=m(y[A],y[A+1],f[A],f[A+1],g,D,w)}const e=f[E-1];D[w++]=r.Color.floatToByte(e.red),D[w++]=r.Color.f