sdrangel/plugins/feature/map/Cesium/Workers/createCorridorOutlineGeomet...

2 lines
7.2 KiB
JavaScript
Raw Normal View History

2022-02-04 15:41:22 -05:00
define(["./GeometryOffsetAttribute-4f901209","./arrayRemoveDuplicates-ee080d9d","./Transforms-ab7258fe","./Matrix2-46444433","./RuntimeError-608565a6","./ComponentDatatype-692a36d3","./PolylineVolumeGeometryLibrary-7cb18244","./CorridorGeometryLibrary-56a78daf","./when-229515d6","./GeometryAttribute-d3bef603","./GeometryAttributes-b253752a","./IndexDatatype-7c683b18","./PolygonPipeline-259e0bdf","./combine-35b6d9cb","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-4deba134","./AxisAlignedBoundingBox-8f6cec20","./IntersectionTests-4cf437d5","./Plane-1f2a7880","./PolylinePipeline-3b21ed18","./EllipsoidGeodesic-94d72244","./EllipsoidRhumbLine-9cd85d72"],(function(e,t,i,r,o,n,s,a,l,d,u,p,f,c,h,y,g,b,m,A,_,E){"use strict";const C=new r.Cartesian3,G=new r.Cartesian3,T=new r.Cartesian3;function P(e,t){const i=[],o=e.positions,f=e.corners,c=e.endPositions,h=new u.GeometryAttributes;let y,g,b,m=0,A=0,_=0;for(g=0;g<o.length;g+=2)b=o[g].length-3,m+=b,_+=b/3*4,A+=o[g+1].length-3;for(m+=3,A+=3,g=0;g<f.length;g++){y=f[g];const e=f[g].leftPositions;l.defined(e)?(b=e.length,m+=b,_+=b/3*2):(b=f[g].rightPositions.length,A+=b,_+=b/3*2)}const E=l.defined(c);let P;E&&(P=c[0].length-3,m+=P,A+=P,P/=3,_+=4*P);const v=m+A,w=new Float64Array(v);let L,D,x,k,N,O,V=0,H=v-1;const I=P/2,S=p.IndexDatatype.createTypedArray(v/3,_+4);let B=0;if(S[B++]=V/3,S[B++]=(H-2)/3,E){i.push(V/3),O=C,N=G;const e=c[0];for(g=0;g<I;g++)O=r.Cartesian3.fromArray(e,3*(I-1-g),O),N=r.Cartesian3.fromArray(e,3*(I+g),N),a.CorridorGeometryLibrary.addAttribute(w,N,V),a.CorridorGeometryLibrary.addAttribute(w,O,void 0,H),D=V/3,k=D+1,L=(H-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,V+=3,H-=3}let M=0,R=o[M++],U=o[M++];for(w.set(R,V),w.set(U,H-U.length+1),b=U.length-3,i.push(V/3,(H-2)/3),g=0;g<b;g+=3)D=V/3,k=D+1,L=(H-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,V+=3,H-=3;for(g=0;g<f.length;g++){let e;y=f[g];const n=y.leftPositions,d=y.rightPositions;let u,p=T;if(l.defined(n)){for(H-=3,u=x,i.push(k),e=0;e<n.length/3;e++)p=r.Cartesian3.fromArray(n,3*e,p),S[B++]=u-e-1,S[B++]=u-e,a.CorridorGeometryLibrary.addAttribute(w,p,void 0,H),H-=3;i.push(u-Math.floor(n.length/6)),t===s.CornerType.BEVELED&&i.push((H-2)/3+1),V+=3}else{for(V+=3,u=k,i.push(x),e=0;e<d.length/3;e++)p=r.Cartesian3.fromArray(d,3*e,p),S[B++]=u+e,S[B++]=u+e+1,a.CorridorGeometryLibrary.addAttribute(w,p,V),V+=3;i.push(u+Math.floor(d.length/6)),t===s.CornerType.BEVELED&&i.push(V/3-1),H-=3}for(R=o[M++],U=o[M++],R.splice(0,3),U.splice(U.length-3,3),w.set(R,V),w.set(U,H-U.length+1),b=U.length-3,e=0;e<U.length;e+=3)k=V/3,D=k-1,x=(H-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,V+=3,H-=3;V-=3,H+=3,i.push(V/3,(H-2)/3)}if(E){V+=3,H-=3,O=C,N=G;const e=c[1];for(g=0;g<I;g++)O=r.Cartesian3.fromArray(e,3*(P-g-1),O),N=r.Cartesian3.fromArray(e,3*g,N),a.CorridorGeometryLibrary.addAttribute(w,O,void 0,H),a.CorridorGeometryLibrary.addAttribute(w,N,V),k=V/3,D=k-1,x=(H-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,V+=3,H-=3;i.push(V/3)}else i.push(V/3,(H-2)/3);return S[B++]=V/3,S[B++]=(H-2)/3,h.position=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:h,indices:S,wallIndices:i}}function v(e){const t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions,i=e.width,o=l.defaultValue(e.height,0),a=l.defaultValue(e.extrudedHeight,o);this._positions=t,this._ellipsoid=r.Ellipsoid.clone(l.defaultValue(e.ellipsoid,r.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(o,a),this._extrudedHeight=Math.min(o,a),this._cornerType=l.defaultValue(e.cornerType,s.CornerType.ROUNDED),this._granularity=l.defaultValue(e.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+6}v.pack=function(e,t,i){i=l.defaultValue(i,0);const o=e._positions,n=o.length;t[i++]=n;for(let e=0;e<n;++e,i+=r.Cartesian3.packedLength)r.Cartesian3.pack(o[e],t,i);return r.Ellipsoid.pack(e._ellipsoid,t,i),i+=r.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=