1 |
- define(["./createTaskProcessorWorker","./ComponentDatatype-81047f82","./Color-45274500","./getStringFromTypedArray-1e6dda18","./S3MCompressType-be5206ad","./Cartographic-67e73ef9","./PrimitiveType-cdfe443e","./S3MPixelFormat-20d43dc4","./pako_inflate-60a34f49","./when-92c6cf3c","./Check-52a7d806","./WebGLConstants-71f10989","./FeatureDetection-067cb23c","./Math-92c3b5f7","./RuntimeError-c6a62a80","./Buffer-1d0f8963","./IndexDatatype-4c0e98b8","./Cartesian4-ad128b5d"],(function(t,e,n,r,a,i,o,E,s,y,p,T,u,l,A,v,_,c){"use strict";function f(t,e,n,r,a,i){this.left=t,this.bottom=e,this.right=n,this.top=r,this.minHeight=a,this.maxHeight=i,this.width=n-t,this.length=r-e,this.height=i-a}function d(t,n,r,E,s,y,p){var T=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var u=0,l={},A=l.vertexAttributes=[],v=l.attrLocation={};l.instanceCount=0,l.instanceMode=0;var _=0;s.getUint32(y,!0),y+=Uint32Array.BYTES_PER_ELEMENT;var c=s.getUint16(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var f=c;c>4&&(f=c>>8,c&=15);var d=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var m=void 0,B=void 0;if(d>0){var g=s.getUint16(y,!0);g=c*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=d*g;var P=E.subarray(y,y+u);if(r){var U=new i.t,L=new i.t,h=new Float32Array(P.buffer,P.byteOffset,P.byteLength/4),M=new i.t$1;m=new i.t$1,B=new i.t$1;for(var S=new Float32Array(2*d),N=new Float64Array(2*d),R=0;R<d;R++)o.y.multiplyByPoint(n,i.t.fromElements(h[3*R],h[3*R+1],h[3*R+2],U),L),M=i.t$1.fromCartesian(L),N[2*R]=M.longitude,N[2*R+1]=M.latitude,0===R?(m.longitude=M.longitude,m.latitude=M.latitude,B.longitude=M.longitude,B.latitude=M.latitude):(m.longitude=Math.max(M.longitude,m.longitude),m.latitude=Math.max(M.latitude,m.latitude),B.longitude=Math.min(M.longitude,B.longitude),B.latitude=Math.min(M.latitude,B.latitude));for(R=0;R<d;R++)S[2*R]=N[2*R]-B.longitude,S[2*R+1]=N[2*R+1]-B.latitude;v.img=_,A.push({index:v.img,typedArray:S,componentsPerAttribute:2,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),_++}v.aPosition=_,A.push({index:v.aPosition,typedArray:P,componentsPerAttribute:c,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:g,normalize:!1}),_++,y+=u}var D=s.getUint32(y,!0);if(y+=Uint32Array.BYTES_PER_ELEMENT,D>0){var Y=s.getUint16(y,!0);Y=f*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=D*Y;let n=new Float32Array(E.buffer,y,3),r=0===n[0]&&0===n[1]&&0===n[2];t.ignoreNormal||r||(v.aNormal=_,A.push({index:v.aNormal,typedArray:E.subarray(y,y+u),componentsPerAttribute:f,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Y,normalize:!1}),_++),y+=u}var I=s.getUint32(y,!0);if(y+=Uint32Array.BYTES_PER_ELEMENT,I>0){var x=new Uint8Array(4*I);p.push(x.buffer);var F=s.getUint32(y,!0);F=4*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=I*F;for(var b=new Float32Array(E.buffer,y,4*d),C=0;C<d;C++)x[4*C]=255*b[4*C],x[4*C+1]=255*b[4*C+1],x[4*C+2]=255*b[4*C+2],x[4*C+3]=255*b[4*C+3];y+=u,v.aColor=_,A.push({index:v.aColor,typedArray:x,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),_++}var w=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT,w>0&&(y+=u=16*w);var O=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;for(var k,z,G=-1,H=0;H<O;H++){k=s.getUint32(y,!0),y+=Uint32Array.BYTES_PER_ELEMENT,z=s.getUint16(y,!0),y+=Uint16Array.BYTES_PER_ELEMENT,s.getUint16(y,!0),y+=Uint16Array.BYTES_PER_ELEMENT,u=k*z*Float32Array.BYTES_PER_ELEMENT;var $,W=E.subarray(y,y+u);if(-1!=G||20!=z&&35!=z)if(-1!==G)l.instanceBounds=new Float32Array(E.buffer,y,k*z);else{var V="aTexCoord"+H;v[V]=_++,A.push({index:v[V],typedArray:W,componentsPerAttribute:z,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:z*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}else G=H,l.instanceCount=k,l.instanceMode=z,l.instanceBuffer=W,20===z?($=20*Float32Array.BYTES_PER_ELEMENT,v.uv2=_++,A.push({index:v.uv2,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:$,instanceDivisor:1}),v.uv3=_++,A.push({index:v.uv3,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv4=_++,A.push({index:v.uv4,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.secondary_colour=_++,A.push({index:v.secondary_colour,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv6=_++,A.push({index:v.uv6,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1})):35===z&&($=35*Float32Array.BYTES_PER_ELEMENT,v.uv1=_++,A.push({index:v.uv1,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:$,instanceDivisor:1,byteLength:u}),v.uv2=_++,A.push({index:v.uv2,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv3=_++,A.push({index:v.uv3,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv4=_++,A.push({index:v.uv4,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv5=_++,A.push({index:v.uv5,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv6=_++,A.push({index:v.uv6,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv7=_++,A.push({index:v.uv7,componentsPerAttribute:3,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.secondary_colour=_++,A.push({index:v.secondary_colour,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}),v.uv9=_++,A.push({index:v.uv9,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:31*Float32Array.BYTES_PER_ELEMENT,strideInBytes:$,instanceDivisor:1}));y+=u}l.verticesCount=d,l.instanceIndex=G;var X=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var j,q=[];for(H=0;H<X;H++){var J={},K=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var Q=s.getUint8(y,!0);y+=Uint8Array.BYTES_PER_ELEMENT,s.getUint8(y,!0),y+=Uint8Array.BYTES_PER_ELEMENT;var Z=s.getUint8(y,!0);y+=Uint8Array.BYTES_PER_ELEMENT,y+=1,J.indicesCount=K,J.indexType=Q,J.primitiveType=Z;var tt=y;K>0&&(0==Q?(y+=u=K*Uint16Array.BYTES_PER_ELEMENT,K%2==1&&(y+=2)):y+=u=4*K),J.indicesTypedArray=E.subarray(tt,tt+u);var et=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var nt=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT*et,J.materialCode=nt,q.push(J)}return 2===q.length&&13===q[1].primitiveType&&q[1].indicesCount>=3&&(j=a._0x5598e9.createEdgeDataByIndices(l,q[1],p)),t[T]={vertexPackage:l,arrIndexPackage:q,edgeGeometry:j,cartographicBounds:{max:m,min:B}},y}function m(t,n,r){var a=t.vertexAttributes,i=t.attrLocation,o=a.length;i[1===r?"instanceId":"batchId"]=o,a.push({index:o,typedArray:n,componentsPerAttribute:1,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:r})}return new n.e,t((function(t,e){var n=t.buffer,i=t.supportCompressType,o=t.bVolume,p=null,T=null,u=null,l=t.isCoverImageryLayer,A=t.modelMatrix;if(o&&t.volbuffer.byteLength<8&&(o=!1),o){var v=t.volbuffer,_=new Uint8Array(v,8),c=s.pako.inflate(_).buffer,B=new Float64Array(c,0,1),g=new Uint32Array(c,48,1);if(0===B[0]||3200===g[0]||3201===g[0]){var P=0;0===B[0]&&(P=8),e.push(c);var U=new Float64Array(c,P,6),L=U[0],h=U[1],M=U[2],S=U[3],N=U[4]<U[5]?U[4]:U[5],R=U[4]>U[5]?U[4]:U[5];T={left:L,top:h,right:M,bottom:S,minHeight:N,maxHeight:R,width:(p=new f(L,S,M,h,N,R)).width,length:p.length,height:p.height};var D=new Uint32Array(c,48+P,7),Y=D[0],I=D[1],x=D[2],F=D[3];u={nFormat:Y,nSideBlockCount:I,nBlockLength:x,nLength:F,nWidth:D[4],nHeight:D[5],nDepth:D[6],imageArray:new Uint8Array(c,76+P,F*F*4)}}}var b=0,C=new Uint8Array(n,0,4);if(115!==C[0]||51!==C[1]||109!==C[2])return{result:!1};var w=C[3],O=(_=new Uint8Array(n,4),s.pako.inflate(_).buffer),k=new Uint8Array(O);e.push(k.buffer);var z=new DataView(O),G=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var H=new Uint8Array(O,b,G),$=G%4;$&&($=4-$),b+=G+$;var W=r.a(H,void 0,void 0,"gbk");W=(W=W.replace(new RegExp("\r\n","gm"),"")).replace(new RegExp(":","gm"),""),z.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT;var V=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var X={};X.ignoreNormal=t.ignoreNormal;for(var j=0;j<V;j++)b=d(X,A,l,k,z,b,e);z.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT;var q=z.getUint32(b,!0);for(b+=Uint32Array.BYTES_PER_ELEMENT,j=0;j<q;j++){var J=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var K=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Q={},Z=X[J].vertexPackage.instanceIndex,tt=X[J].edgeGeometry;if(-1==Z){for(var et=new Float32Array(X[J].vertexPackage.verticesCount),nt=0;nt<K;nt++){var rt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var at=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var it=0,ot=0;Q[rt]={batchId:nt};for(var Et=0;Et<at;Et++)if(ot=z.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT,it=z.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT,et.fill)et.fill(nt,ot,ot+it);else for(var st=ot+ot,yt=ot;yt<st;yt++)et[yt]=nt;Q[rt].vertexColorOffset=ot,Q[rt].vertexColorCount=it}m(X[J].vertexPackage,et,void 0)}else{var pt=X[J].vertexPackage.instanceCount;X[J].vertexPackage.instanceBuffer,X[J].vertexPackage.instanceMode;var Tt=new Float32Array(pt),ut=0;for(nt=0;nt<K;nt++){rt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;at=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;for(Et=0;Et<at;Et++){var lt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT,Tt[ut]=ut,void 0===Q[rt]&&(Q[rt]={vertexColorCount:1,instanceIds:[],vertexColorOffset:ut}),Q[rt].instanceIds.push(lt),ut++}}m(X[J].vertexPackage,Tt,1)}X[J].pickInfo=Q;tt=X[J].edgeGeometry;if(y.e(tt)){var At,vt,_t=tt.regular.instancesData,ct=a._0x5598e9.RegularInstanceStride;if(y.e(_t))for(vt=_t.length,At=0;At<vt;At+=ct){var ft=_t[At+9];_t[At+9]=et[ft]}var dt=tt.silhouette.instancesData;if(ct=a._0x5598e9.SilhouetteInstanceStride,y.e(dt))for(vt=dt.length,At=0;At<vt;At+=ct){ft=dt[At+12];dt[At+12]=et[ft]}}}z.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT;var mt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Bt={};for(j=0;j<mt;j++){var gt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Pt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Ut=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Lt=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;at=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var ht=z.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var Mt=null;if(Lt===a.S3MCompressType.enrS3TCDXTN&&1!==i){var St=null;ht>E.S3MPixelFormat.BGR||ht===E.S3MPixelFormat.LUMINANCE_ALPHA?(St=new Uint8Array(O,b,Pt*Ut),Mt=new Uint8Array(Pt*Ut*4)):(St=new Uint16Array(O,b,at/2),Mt=new Uint16Array(Pt*Ut)),a.L.decode(Mt,Pt,Ut,St,ht),e.push(Mt.buffer),Lt=0}else Mt=new Uint8Array(O,b,at);Bt[gt]={id:gt,width:Pt,height:Ut,compressType:Lt,nFormat:ht,imageBuffer:Mt},b+=at}return{result:!0,version:w,xmlDoc:W,geoPackage:X,texturePackage:Bt,volImageBuffer:u,volBounds:T}}))}));
|