月球大数据地理空间分析展示平台-【前端】-月球2期前端
surprise
2023-10-31 b4bffdef9d944ee0982a08e0ea06b5a4a2f829d0
1
define(["./AxisAlignedBoundingBox-11f38250","./Matrix2-50a93848","./Matrix3-ef89a1eb","./defaultValue-abec0268","./TerrainEncoding-fcef5400","./IndexDatatype-5f9fa3ed","./Math-a56d1479","./Transforms-ed424165","./WebMercatorProjection-6a6cf968","./createTaskProcessorWorker","./RuntimeError-279c39be","./AttributeCompression-29f13287","./ComponentDatatype-565a8190","./WebGLConstants-292d99ef","./combine-7a07cedd"],(function(e,t,r,n,o,i,a,s,c,h,l,d,u,I,g){"use strict";function m(){s.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:s.DeveloperError.throwInstantiationError},credit:{get:s.DeveloperError.throwInstantiationError},tilingScheme:{get:s.DeveloperError.throwInstantiationError},ready:{get:s.DeveloperError.throwInstantiationError},readyPromise:{get:s.DeveloperError.throwInstantiationError},hasWaterMask:{get:s.DeveloperError.throwInstantiationError},hasVertexNormals:{get:s.DeveloperError.throwInstantiationError},availability:{get:s.DeveloperError.throwInstantiationError}});const f=[];m.getRegularGridIndices=function(e,t){let r=f[e];n.defined(r)||(f[e]=r=[]);let o=r[t];return n.defined(o)||(o=e*t<a.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),E(e,t,o,0)),o};const y=[];m.getRegularGridIndicesAndEdgeIndices=function(e,t){let r=y[e];n.defined(r)||(y[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=m.getRegularGridIndices(e,t),i=p(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,h=i.northIndicesWestToEast;o=r[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:h}}return o};const T=[];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 E(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 x(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 r=T[e];n.defined(r)||(T[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=n+s,h=a+6*Math.max(0,s-4),l=p(e,t),d=l.westIndicesSouthToNorth,u=l.southIndicesEastToWest,I=l.eastIndicesNorthToSouth,g=l.northIndicesWestToEast,f=i.IndexDatatype.createTypedArray(c,h);E(e,t,f,0),m.addSkirtIndices(d,u,I,g,n,f,a),o=r[t]={indices:f,westIndicesSouthToNorth:d,southIndicesEastToWest:u,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return o},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=x(e,s,i,a),s+=e.length,a=x(t,s,i,a),s+=t.length,a=x(r,s,i,a),s+=r.length,x(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=s.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=s.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=s.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=s.DeveloperError.throwInstantiationError;const N=32767,w=new r.Cartesian3,M=new r.Cartesian3,S=new r.Cartesian3,b=new r.Cartographic,A=new t.Cartesian2,C=new r.Cartographic,W=[],v=[];function P(e,t){let r,n,o,i,a=0;const s=t.length;for(o=t[0],r=1;r<=s;r++)i=t[r%s],e[0]>Math.min(o[0],i[0])&&e[0]<=Math.max(o[0],i[0])&&e[1]<=Math.max(o[1],i[1])&&o[0]!==i[0]&&(n=(e[0]-o[0])*(i[1]-o[1])/(i[0]-o[0])+o[1],(o[1]===i[1]||e[1]<=n)&&a++),o=i;return a%2!=0}function k(e,t,r,n){const o=(e.x-r.x)*(t.y-r.y)-(e.y-r.y)*(t.x-r.x),i=(e.x-n.x)*(t.y-n.y)-(e.y-n.y)*(t.x-n.x);if(o*i>=0)return!1;const a=(r.x-e.x)*(n.y-e.y)-(r.y-e.y)*(n.x-e.x);if(a*(a+o-i)>=0)return!1;const s=a/(i-o),c=s*(t.x-e.x),h=s*(t.y-e.y);return{x:e.x+c,y:e.y+h}}function D(e,n,o,i,s,c,h,l,d){let u=Number.POSITIVE_INFINITY;const I=s.north,g=s.south;let m=s.east;const f=s.west;m<f&&(m+=a.CesiumMath.TWO_PI);const y=e.length;for(let s=0;s<y;++s){const y=e[s],T=o[y],p=i[y];b.longitude=a.CesiumMath.lerp(f,m,p.x),b.latitude=a.CesiumMath.lerp(g,I,p.y),b.height=T-n;const E=c.cartographicToCartesian(b,w);t.Matrix4.multiplyByPoint(h,E,E),r.Cartesian3.minimumByComponent(E,l,l),r.Cartesian3.maximumByComponent(E,d,d),u=Math.min(u,b.height)}return u}function F(e,t,r,o,i,s,h,l,d,u,I,g,m,f){const y=n.defined(h),T=d.north,p=d.south;let E=d.east;const x=d.west;E<x&&(E+=a.CesiumMath.TWO_PI);const N=r.length;for(let n=0;n<N;++n){const d=r[n],N=i[d],M=s[d];b.longitude=a.CesiumMath.lerp(x,E,M.x)+m,b.latitude=a.CesiumMath.lerp(p,T,M.y)+f,b.height=N-u;const S=l.cartographicToCartesian(b,w);if(y){const e=2*d;A.x=h[e],A.y=h[e+1]}let C,W;o.hasWebMercatorT&&(C=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=l.geodeticSurfaceNormal(S)),t=o.encode(e,t,S,M,b.height,A,C,W,1)}}function H(e,t){let r;return"function"==typeof e.slice&&(r=e.slice(),"function"!=typeof r.sort&&(r=void 0)),n.defined(r)||(r=Array.prototype.slice.call(e)),r.sort(t),r}return h((function(h,l){const d=h.flattenPolygonHeight||[1],u=h.flattenPolygon||[];let I=-65565;const g=h.quantizedVertices,f=g.length/3,y=h.octEncodedNormals,T=h.westIndices.length+h.eastIndices.length+h.southIndices.length+h.northIndices.length,p=h.includeWebMercatorT,E=h.exaggeration,x=h.exaggerationRelativeHeight,_=1!==E,G=t.Rectangle.clone(h.rectangle),V=G.west,Y=G.south,O=G.east,B=G.north;W.length=0,v.length=0;let R=!1;const L=[[V,Y],[O,Y],[O,B],[V,B]];for(let e=0;e<d.length;e++)if(1!==d[e]){R=!1;for(let r=0;r<u[e].length;r++){const n=u[e][r];C.longitude=n[0],C.latitude=n[1],C.height=0;if(t.Rectangle.contains(G,C)){W.push(d[e]),v.push(u[e]),R=!0;break}}if(!R)for(let t=0;t<L.length;t++){if(P(L[t],u[e])){W.push(d[e]),v.push(u[e]),R=!0;break}}if(!R)for(let t=0;t<u[e].length-1;t++){for(let r=0;r<L.length-1;r++){if(k({x:L[r][0],y:L[r][1]},{x:L[r+1][0],y:L[r+1][1]},{x:u[e][t][0],y:u[e][t][1]},{x:u[e][t+1][0],y:u[e][t+1][1]})){W.push(d[e]),v.push(u[e]),R=!0;break}}if(R)break}}const j=r.Ellipsoid.clone(h.ellipsoid),U=h.minimumHeight;let z=h.maximumHeight;const q=h.relativeToCenter,Q=s.Transforms.eastNorthUpToFixedFrame(q,j),K=t.Matrix4.inverseTransformation(Q,new t.Matrix4);let X,Z;p&&(X=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(Y),Z=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(B)-X));const J=g.subarray(0,f),$=g.subarray(f,2*f),ee=g.subarray(2*f,3*f),te=n.defined(y),re=new Array(f),ne=new Array(f),oe=new Array(f),ie=p?new Array(f):[],ae=_?new Array(f):[],se=M;se.x=Number.POSITIVE_INFINITY,se.y=Number.POSITIVE_INFINITY,se.z=Number.POSITIVE_INFINITY;const ce=S;ce.x=Number.NEGATIVE_INFINITY,ce.y=Number.NEGATIVE_INFINITY,ce.z=Number.NEGATIVE_INFINITY;let he=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,de=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY;for(let e=0;e<f;++e){const n=J[e],o=$[e],i=n/N,s=o/N;let h=a.CesiumMath.lerp(U,z,ee[e]/N);b.longitude=a.CesiumMath.lerp(V,O,i),b.latitude=a.CesiumMath.lerp(Y,B,s),b.height=h;for(let e=0;e<W.length;e++)if(1!==W[e]){P([b.longitude,b.latitude],v[e])&&(b.height=h=d[e],I=Math.max(I,d[e]))}he=Math.min(b.longitude,he),le=Math.max(b.longitude,le),de=Math.min(b.latitude,de),ue=Math.max(b.latitude,ue);const l=j.cartographicToCartesian(b);re[e]=new t.Cartesian2(i,s),ne[e]=h,oe[e]=l,p&&(ie[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-X)*Z),_&&(ae[e]=j.geodeticSurfaceNormal(l)),t.Matrix4.multiplyByPoint(K,l,w),r.Cartesian3.minimumByComponent(w,se,se),r.Cartesian3.maximumByComponent(w,ce,ce)}-65565!==I&&(z=1.2*I);const Ie=H(h.westIndices,(function(e,t){return re[e].y-re[t].y})),ge=H(h.eastIndices,(function(e,t){return re[t].y-re[e].y})),me=H(h.southIndices,(function(e,t){return re[t].x-re[e].x})),fe=H(h.northIndices,(function(e,t){return re[e].x-re[t].x}));let ye;if(U<0){ye=new o.EllipsoidalOccluder(j).computeHorizonCullingPointPossiblyUnderEllipsoid(q,oe,U)}let Te=U;Te=Math.min(Te,D(h.westIndices,h.westSkirtHeight,ne,re,G,j,K,se,ce)),Te=Math.min(Te,D(h.southIndices,h.southSkirtHeight,ne,re,G,j,K,se,ce)),Te=Math.min(Te,D(h.eastIndices,h.eastSkirtHeight,ne,re,G,j,K,se,ce)),Te=Math.min(Te,D(h.northIndices,h.northSkirtHeight,ne,re,G,j,K,se,ce));const pe=new e.AxisAlignedBoundingBox(se,ce,q),Ee=new o.TerrainEncoding(q,pe,Te,z,Q,te,p,_,E,x),xe=Ee.stride,Ne=new Float32Array(f*xe+T*xe);let we=0;for(let e=0;e<f;++e){if(te){const t=2*e;A.x=y[t],A.y=y[t+1]}we=Ee.encode(Ne,we,oe[e],re[e],ne[e],A,ie[e],ae[e],0)}const Me=Math.max(0,2*(T-4)),Se=h.indices.length+3*Me,be=i.IndexDatatype.createTypedArray(f+T,Se);be.set(h.indices,0);const Ae=1e-4,Ce=(le-he)*Ae,We=(ue-de)*Ae,ve=-Ce,Pe=Ce,ke=We,De=-We;let Fe=f*xe;return F(Ne,Fe,Ie,Ee,ne,re,y,j,G,h.westSkirtHeight,X,Z,ve,0),Fe+=h.westIndices.length*xe,F(Ne,Fe,me,Ee,ne,re,y,j,G,h.southSkirtHeight,X,Z,0,De),Fe+=h.southIndices.length*xe,F(Ne,Fe,ge,Ee,ne,re,y,j,G,h.eastSkirtHeight,X,Z,Pe,0),Fe+=h.eastIndices.length*xe,F(Ne,Fe,fe,Ee,ne,re,y,j,G,h.northSkirtHeight,X,Z,0,ke),m.addSkirtIndices(Ie,me,ge,fe,f,be,h.indices.length),l.push(Ne.buffer,be.buffer),{vertices:Ne.buffer,indices:be.buffer,westIndicesSouthToNorth:Ie,southIndicesEastToWest:me,eastIndicesNorthToSouth:ge,northIndicesWestToEast:fe,vertexStride:xe,center:q,minimumHeight:U,maximumHeight:z,occludeePointInScaledSpace:ye,encoding:Ee,indexCountWithoutSkirts:h.indices.length}}))}));