月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-06-14 a7ceb07fdcbcac1edcecb8c96bfa7808ea7670c5
1
define(["./AxisAlignedBoundingBox-be6909d8","./Matrix2-52f9f880","./defaultValue-69ee94f4","./TerrainEncoding-59543c99","./IndexDatatype-1cbc8622","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./Transforms-3e1dc9c2","./WebMercatorProjection-6f83725a","./createTaskProcessorWorker","./PixelFormat-9ceadbf3","./WebGLConstants-f63312fc","./AttributeCompression-5e4af6de","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I,g){"use strict";function m(){a.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:a.DeveloperError.throwInstantiationError},credit:{get:a.DeveloperError.throwInstantiationError},tilingScheme:{get:a.DeveloperError.throwInstantiationError},ready:{get:a.DeveloperError.throwInstantiationError},readyPromise:{get:a.DeveloperError.throwInstantiationError},hasWaterMask:{get:a.DeveloperError.throwInstantiationError},hasVertexNormals:{get:a.DeveloperError.throwInstantiationError},availability:{get:a.DeveloperError.throwInstantiationError}});const T=[];m.getRegularGridIndices=function(e,t){let n=T[e];r.defined(n)||(T[e]=n=[]);let o=n[t];return r.defined(o)||(o=e*t<i.CesiumMath.SIXTY_FOUR_KILOBYTES?n[t]=new Uint16Array((e-1)*(t-1)*6):n[t]=new Uint32Array((e-1)*(t-1)*6),y(e,t,o,0)),o};const f=[];m.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=f[e];r.defined(n)||(f[e]=n=[]);let o=n[t];if(!r.defined(o)){const r=m.getRegularGridIndices(e,t),i=p(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const E=[];function p(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function y(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function N(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}m.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=E[e];r.defined(n)||(E[e]=n=[]);let i=n[t];if(!r.defined(i)){const r=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=r+s,d=a+6*Math.max(0,s-4),h=p(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,g=h.northIndicesWestToEast,T=o.IndexDatatype.createTypedArray(c,d);y(e,t,T,0),m.addSkirtIndices(u,l,I,g,r,T,a),i=n[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return i},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=N(e,s,i,a),s+=e.length,a=N(t,s,i,a),s+=t.length,a=N(r,s,i,a),s+=r.length,N(n,s,i,a)},m.heightmapTerrainQuality=.25,m.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*m.heightmapTerrainQuality/(t*r)},m.prototype.requestTileGeometry=a.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=a.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=a.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=a.DeveloperError.throwInstantiationError;const w=32767,S=new t.Cartesian3,x=new t.Cartesian3,M=new t.Cartesian3,b=new t.Cartographic,A=new t.Cartesian2;function C(e,r,n,o,a,s,c,d,h){let u=Number.POSITIVE_INFINITY;const l=a.north,I=a.south;let g=a.east;const m=a.west;g<m&&(g+=i.CesiumMath.TWO_PI);const T=e.length;for(let a=0;a<T;++a){const T=e[a],f=n[T],E=o[T];b.longitude=i.CesiumMath.lerp(m,g,E.x),b.latitude=i.CesiumMath.lerp(I,l,E.y),b.height=f-r;const p=s.cartographicToCartesian(b,S);t.Matrix4.multiplyByPoint(c,p,p),t.Cartesian3.minimumByComponent(p,d,d),t.Cartesian3.maximumByComponent(p,h,h),u=Math.min(u,b.height)}return u}function W(e,t,n,o,a,s,d,h,u,l,I,g,m,T){const f=r.defined(d),E=u.north,p=u.south;let y=u.east;const N=u.west;y<N&&(y+=i.CesiumMath.TWO_PI);const w=n.length;for(let r=0;r<w;++r){const u=n[r],w=a[u],x=s[u];b.longitude=i.CesiumMath.lerp(N,y,x.x)+m,b.latitude=i.CesiumMath.lerp(p,E,x.y)+T,b.height=w-l;const M=h.cartographicToCartesian(b,S);if(f){const e=2*u;A.x=d[e],A.y=d[e+1]}let C,W;o.hasWebMercatorT&&(C=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=h.geodeticSurfaceNormal(M)),t=o.encode(e,t,M,x,b.height,A,C,W)}}function v(e,t){let n;return"function"==typeof e.slice&&(n=e.slice(),"function"!=typeof n.sort&&(n=void 0)),r.defined(n)||(n=Array.prototype.slice.call(e)),n.sort(t),n}return d((function(a,d){const h=a.quantizedVertices,u=h.length/3,l=a.octEncodedNormals,I=a.westIndices.length+a.eastIndices.length+a.southIndices.length+a.northIndices.length,g=a.includeWebMercatorT,T=a.exaggeration,f=a.exaggerationRelativeHeight,E=1!==T,p=t.Rectangle.clone(a.rectangle),y=p.west,N=p.south,P=p.east,D=p.north,k=t.Ellipsoid.clone(a.ellipsoid),F=a.minimumHeight,H=a.maximumHeight,_=a.relativeToCenter,G=s.Transforms.eastNorthUpToFixedFrame(_,k),V=t.Matrix4.inverseTransformation(G,new t.Matrix4);let Y,O;g&&(Y=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(N),O=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(D)-Y));const B=h.subarray(0,u),R=h.subarray(u,2*u),L=h.subarray(2*u,3*u),j=r.defined(l),U=new Array(u),z=new Array(u),q=new Array(u),Q=g?new Array(u):[],K=E?new Array(u):[],X=x;X.x=Number.POSITIVE_INFINITY,X.y=Number.POSITIVE_INFINITY,X.z=Number.POSITIVE_INFINITY;const Z=M;Z.x=Number.NEGATIVE_INFINITY,Z.y=Number.NEGATIVE_INFINITY,Z.z=Number.NEGATIVE_INFINITY;let J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,ee=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY;for(let e=0;e<u;++e){const r=B[e],n=R[e],o=r/w,a=n/w,s=i.CesiumMath.lerp(F,H,L[e]/w);b.longitude=i.CesiumMath.lerp(y,P,o),b.latitude=i.CesiumMath.lerp(N,D,a),b.height=s,J=Math.min(b.longitude,J),$=Math.max(b.longitude,$),ee=Math.min(b.latitude,ee),te=Math.max(b.latitude,te);const d=k.cartographicToCartesian(b);U[e]=new t.Cartesian2(o,a),z[e]=s,q[e]=d,g&&(Q[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-Y)*O),E&&(K[e]=k.geodeticSurfaceNormal(d)),t.Matrix4.multiplyByPoint(V,d,S),t.Cartesian3.minimumByComponent(S,X,X),t.Cartesian3.maximumByComponent(S,Z,Z)}const re=v(a.westIndices,(function(e,t){return U[e].y-U[t].y})),ne=v(a.eastIndices,(function(e,t){return U[t].y-U[e].y})),oe=v(a.southIndices,(function(e,t){return U[t].x-U[e].x})),ie=v(a.northIndices,(function(e,t){return U[e].x-U[t].x}));let ae;if(F<0){ae=new n.EllipsoidalOccluder(k).computeHorizonCullingPointPossiblyUnderEllipsoid(_,q,F)}let se=F;se=Math.min(se,C(a.westIndices,a.westSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,C(a.southIndices,a.southSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,C(a.eastIndices,a.eastSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,C(a.northIndices,a.northSkirtHeight,z,U,p,k,V,X,Z));const ce=new e.AxisAlignedBoundingBox(X,Z,_),de=new n.TerrainEncoding(_,ce,se,H,G,j,g,E,T,f),he=de.stride,ue=new Float32Array(u*he+I*he);let le=0;for(let e=0;e<u;++e){if(j){const t=2*e;A.x=l[t],A.y=l[t+1]}le=de.encode(ue,le,q[e],U[e],z[e],A,Q[e],K[e])}const Ie=Math.max(0,2*(I-4)),ge=a.indices.length+3*Ie,me=o.IndexDatatype.createTypedArray(u+I,ge);me.set(a.indices,0);const Te=1e-4,fe=($-J)*Te,Ee=(te-ee)*Te,pe=-fe,ye=fe,Ne=Ee,we=-Ee;let Se=u*he;return W(ue,Se,re,de,z,U,l,k,p,a.westSkirtHeight,Y,O,pe,0),Se+=a.westIndices.length*he,W(ue,Se,oe,de,z,U,l,k,p,a.southSkirtHeight,Y,O,0,we),Se+=a.southIndices.length*he,W(ue,Se,ne,de,z,U,l,k,p,a.eastSkirtHeight,Y,O,ye,0),Se+=a.eastIndices.length*he,W(ue,Se,ie,de,z,U,l,k,p,a.northSkirtHeight,Y,O,0,Ne),m.addSkirtIndices(re,oe,ne,ie,u,me,a.indices.length),d.push(ue.buffer,me.buffer),{vertices:ue.buffer,indices:me.buffer,westIndicesSouthToNorth:re,southIndicesEastToWest:oe,eastIndicesNorthToSouth:ne,northIndicesWestToEast:ie,vertexStride:he,center:_,minimumHeight:F,maximumHeight:H,occludeePointInScaledSpace:ae,encoding:de,indexCountWithoutSkirts:a.indices.length}}))}));