learning_cesium/XbsjCesium/Workers/createCorridorOutlineGeomet...

2 lines
7.1 KiB
JavaScript
Raw Normal View History

2024-03-19 18:06:25 +08:00
define(["./GeometryOffsetAttribute-6e5d8e16","./arrayRemoveDuplicates-db90b85c","./Transforms-251ff661","./Cartesian2-697a9954","./Check-f3fec9b0","./ComponentDatatype-417761a2","./PolylineVolumeGeometryLibrary-82babed3","./CorridorGeometryLibrary-b7e7396f","./when-54335d57","./GeometryAttribute-7ca1c9e4","./GeometryAttributes-caa08d6c","./IndexDatatype-c134ea39","./Math-737a2579","./PolygonPipeline-1048742e","./RuntimeError-88a32665","./WebGLConstants-4739ce15","./EllipsoidTangentPlane-ae33ec6a","./AxisAlignedBoundingBox-dcfdb7a9","./IntersectionTests-3e34a0aa","./Plane-d4cb7bb3","./PolylinePipeline-d9c22c71","./EllipsoidGeodesic-efd225af","./EllipsoidRhumbLine-e5c51fa7"],function(A,u,p,B,e,M,R,U,F,Y,q,W,f,v,t,i,r,o,a,n,s,l,d){"use strict";var J=new B.Cartesian3,j=new B.Cartesian3,z=new B.Cartesian3;function _(e,t){var i,r=[],o=e.positions,a=e.corners,n=e.endPositions,s=new q.GeometryAttributes,l=0,d=0,u=0;for(L=0;L<o.length;L+=2)l+=i=o[L].length-3,u+=i/3*4,d+=o[L+1].length-3;for(l+=3,d+=3,L=0;L<a.length;L++){var p=a[L],f=a[L].leftPositions;F.defined(f)?l+=i=f.length:d+=i=a[L].rightPositions.length,u+=i/3*2}var h,y=F.defined(n);y&&(l+=h=n[0].length-3,d+=h,u+=4*(h/=3));var c,g,b,m,e=l+d,A=new Float64Array(e),v=0,_=e-1,E=h/2,C=W.IndexDatatype.createTypedArray(e/3,u+4),G=0;if(C[G++]=v/3,C[G++]=(_-2)/3,y){r.push(v/3);for(var T=J,P=j,w=n[0],L=0;L<E;L++)T=B.Cartesian3.fromArray(w,3*(E-1-L),T),P=B.Cartesian3.fromArray(w,3*(E+L),P),U.CorridorGeometryLibrary.addAttribute(A,P,v),U.CorridorGeometryLibrary.addAttribute(A,T,void 0,_),m=(g=v/3)+1,b=(c=(_-2)/3)-1,C[G++]=c,C[G++]=b,C[G++]=g,C[G++]=m,v+=3,_-=3}var D=0,k=o[D++],x=o[D++];for(A.set(k,v),A.set(x,_-x.length+1),i=x.length-3,r.push(v/3,(_-2)/3),L=0;L<i;L+=3)m=(g=v/3)+1,b=(c=(_-2)/3)-1,C[G++]=c,C[G++]=b,C[G++]=g,C[G++]=m,v+=3,_-=3;for(L=0;L<a.length;L++){var N,O,V=(p=a[L]).leftPositions,H=p.rightPositions,I=z;if(F.defined(V)){for(_-=3,O=b,r.push(m),N=0;N<V.length/3;N++)I=B.Cartesian3.fromArray(V,3*N,I),C[G++]=O-N-1,C[G++]=O-N,U.CorridorGeometryLibrary.addAttribute(A,I,void 0,_),_-=3;r.push(O-Math.floor(V.length/6)),t===R.CornerType.BEVELED&&r.push((_-2)/3+1),v+=3}else{for(v+=3,O=m,r.push(b),N=0;N<H.length/3;N++)I=B.Cartesian3.fromArray(H,3*N,I),C[G++]=O+N,C[G++]=O+N+1,U.CorridorGeometryLibrary.addAttribute(A,I,v),v+=3;r.push(O+Math.floor(H.length/6)),t===R.CornerType.BEVELED&&r.push(v/3-1),_-=3}for(k=o[D++],x=o[D++],k.splice(0,3),x.splice(x.length-3,3),A.set(k,v),A.set(x,_-x.length+1),i=x.length-3,N=0;N<x.length;N+=3)g=(m=v/3)-1,C[G++]=c=(b=(_-2)/3)+1,C[G++]=b,C[G++]=g,C[G++]=m,v+=3,_-=3;v-=3,_+=3,r.push(v/3,(_-2)/3)}if(y){v+=3,_-=3,T=J,P=j;var S=n[1];for(L=0;L<E;L++)T=B.Cartesian3.fromArray(S,3*(h-L-1),T),P=B.Cartesian3.fromArray(S,3*L,P),U.CorridorGeometryLibrary.addAttribute(A,T,void 0,_),U.CorridorGeometryLibrary.addAttribute(A,P,v),g=(m=v/3)-1,C[G++]=c=(b=(_-2)/3)+1,C[G++]=b,C[G++]=g,C[G++]=m,v+=3,_-=3;r.push(v/3)}else r.push(v/3,(_-2)/3);return C[G++]=v/3,C[G++]=(_-2)/3,s.position=new Y.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:C,wallIndices:r}}function h(e){var t=(e=F.defaultValue(e,F.defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=F.defaultValue(e.height,0),o=F.defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=B.Ellipsoid.clone(F.defaultValue(e.ellipsoid,B.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,o),this._extrudedHeight=Math.min(r,o),this._cornerType=F.defaultValue(e.cornerType,R.CornerType.ROUNDED),this._granularity=F.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*B.Cartesian3.packedLength+B.Ellipsoid.packedLength+6}h.pack=function(e,t,i){i=F.defaultValue(i,0);var r=e._positions,o=r.length;t[i++]=o;for(var a=0;a<o;++a,i+=B.Cartesian3.packedLength)B.Cartesian3.pack(r[a],t,i);return B.Ellipsoid.pack(e._ellipsoid,t,i),i+=B.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=