NuclearDispersionSystem/ant-design-vue-jeecg/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js

27 lines
7.7 KiB
JavaScript
Raw Normal View History

2023-09-18 11:40:16 +08:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.109
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as Gt,b as Xt}from"./chunk-DMHOSKRF.js";import{a as kt}from"./chunk-ITS5OBIO.js";import{a as lt}from"./chunk-NHJ7LQMB.js";import{a as Dt}from"./chunk-6Z3TD6OI.js";import"./chunk-YZMLQP2E.js";import"./chunk-YTG33ZHK.js";import{a as qt}from"./chunk-LLBHZLGF.js";import"./chunk-YYMHH3T4.js";import"./chunk-ATQXFTWF.js";import{d as zt,i as Lt}from"./chunk-NNIY7VTE.js";import"./chunk-NX64RCXJ.js";import{b as $,c as Ot,d as wt}from"./chunk-5EDTRNG5.js";import"./chunk-IO6LETQ6.js";import{a as P,b as N,c as Ht}from"./chunk-C6Y3PRDH.js";import{a as r}from"./chunk-LI57NJAL.js";import"./chunk-IBAO62UG.js";import{a as Vt}from"./chunk-3NARV6MR.js";import{a as Ut}from"./chunk-P44SUSQU.js";import"./chunk-FUATUYJ3.js";import{e as ht}from"./chunk-ODUTJJQ5.js";var te=Uint16Array.BYTES_PER_ELEMENT,mt=Int32Array.BYTES_PER_ELEMENT,Pt=Uint32Array.BYTES_PER_ELEMENT,ee=Float32Array.BYTES_PER_ELEMENT,H=Float64Array.BYTES_PER_ELEMENT;function tt(n,l,e){e=Ut(e,r);let i=n.length;for(let c=0;c<i;++c)if(e.equalsEpsilon(n[c],l,r.EPSILON12))return c;return-1}function oe(n,l){n.ellipsoid=Ht.clone(n.ellipsoid),n.rectangle=Ot.clone(n.rectangle);let e=se(n.buffer,n.relativeToCenter,n.ellipsoid,n.rectangle,n.nativeRectangle,n.exaggeration,n.exaggerationRelativeHeight,n.skirtHeight,n.includeWebMercatorT,n.negativeAltitudeExponentBias,n.negativeElevationThreshold),i=e.vertices;l.push(i.buffer);let c=e.indices;return l.push(c.buffer),{vertices:i.buffer,indices:c.buffer,numberOfAttributes:e.encoding.stride,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere3D:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,occludeePointInScaledSpace:e.occludeePointInScaledSpace,encoding:e.encoding,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,westIndicesSouthToNorth:e.westIndicesSouthToNorth,southIndicesEastToWest:e.southIndicesEastToWest,eastIndicesNorthToSouth:e.eastIndicesNorthToSouth,northIndicesWestToEast:e.northIndicesWestToEast}}var u=new N,G=new P,ne=new P,ie=new P,re=new $;function se(n,l,e,i,c,et,m,ot,T,nt,it){let I,h,E,f,x,p;ht(i)?(I=i.west,h=i.south,E=i.east,f=i.north,x=i.width,p=i.height):(I=r.toRadians(c.west),h=r.toRadians(c.south),E=r.toRadians(c.east),f=r.toRadians(c.north),x=r.toRadians(i.width),p=r.toRadians(i.height));let X=[h,f],A=[I,E],V=Lt.eastNorthUpToFixedFrame(l,e),j=$.inverseTransformation(V,re),O,Q;T&&(O=lt.geodeticLatitudeToMercatorAngle(h),Q=1/(lt.geodeticLatitudeToMercatorAngle(f)-O));let y=et!==1,a=new DataView(n),z=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,b=ne;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;let M=ie;M.x=Number.NEGATIVE_INFINITY,M.y=Number.NEGATIVE_INFINITY,M.z=Number.NEGATIVE_INFINITY;let o=0,S=0,At=0,rt,L;for(L=0;L<4;++L){let t=o;rt=a.getUint32(t,!0),t+=Pt;let d=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(A,d)===-1&&A.push(d);let Y=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(X,Y)===-1&&X.push(Y),t+=2*H;let B=a.getInt32(t,!0);t+=mt,S+=B,B=a.getInt32(t,!0),At+=B*3,o+=rt+Pt}let yt=[],bt=[],g=new Array(S),R=new Array(S),_=new Array(S),C=T?new Array(S):[],F=y?new Array(S):[],v=new Array(At),k=[],st=[],ct=[],W=[],s=0,pt=0;for(o=0,L=0;L<4;++L){rt=a.getUint32(o,!0),o+=Pt;let t=o,d=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let Y=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let B=r.toRadians(a.getFloat64(o,!0)*180),Ft=B*.5;o+=H;let vt=r.toRadians(a.getFloat64(o,!0)*180),Wt=vt*.5;o+=H;let Yt=a.getInt32(o,!0);o+=mt;let Zt=a.getInt32(o,!0);o+=mt,o+=mt;let St=new Array(Yt);for(let U=0;U<Yt;++U){let Z=d+a.getUint8(o++)*B;u.longitude=Z;let D=Y+a.getUint8(o++)*vt;u.latitude=D;let w=a.getFloat32(o,!0);if(o+=ee,w!==0&&w<it&&(w*=-Math.pow(2,nt)),w*=6371010,u.height=w,tt(A,Z)!==-1||tt(X,D)!==-1){let dt=tt(yt,u,N);if(dt===-1)yt.push(N.clone(u)),bt.push(s);else{St[U]=bt[dt];continue}}St[U]=s,Math.abs(Z-I)<Ft?k.push({index:s,cartographic:N.clone(u)}):Math.abs(Z-E)<Ft?ct.push({index:s,cartographic:N.clone(u)}):Math.abs(D-h)<Wt?st.push({index:s,cartographic:N.clone(u)}):Math.abs(D-f)<Wt&&W.push({index:s,cartogr