qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/createGroundPolylineGeometr...

2 lines
16 KiB
JavaScript
Raw Permalink Normal View History

2024-01-02 14:12:39 +08:00
define(["./BoundingSphere-9a3b5656","./Transforms-5b829630","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./defaultValue-81eec7ed","./GeographicTilingScheme-86cef90e","./Rectangle-cf3e0e3e","./Resource-8ae1a924","./ArcType-fc72c06c","./arrayRemoveDuplicates-cea3b206","./ComponentDatatype-aaeec80f","./EllipsoidGeodesic-e7a5ca44","./EllipsoidRhumbLine-592e8885","./EncodedCartesian3-aafcc30f","./GeographicProjection-c931c7fb","./GeometryAttribute-2b42a913","./IntersectionTests-80510c7b","./Math-e73894ab","./Matrix4-4c545f70","./Plane-bc8b6777","./WebMercatorProjection-44373a3d","./when-422ea0ae","./RuntimeError-26acdd3b","./combine-3c023bda","./WebGLConstants-508b9636","./Matrix2-dc0c61cc"],(function(e,a,t,n,i,r,s,o,c,l,u,C,p,d,h,g,m,f,w,y,E,M,T,S,k,P,_){"use strict";const b=new n.Cartesian3,O=new n.Cartesian3,A=new t.Cartographic,x=new n.Cartesian3,I=new n.Cartesian3,L=new e.BoundingSphere,N=new s.GeographicTilingScheme,R=[new t.Cartographic,new t.Cartographic,new t.Cartographic,new t.Cartographic],D=new t.Cartesian2,z={};function H(e){t.Cartographic.fromRadians(e.east,e.north,0,R[0]),t.Cartographic.fromRadians(e.west,e.north,0,R[1]),t.Cartographic.fromRadians(e.east,e.south,0,R[2]),t.Cartographic.fromRadians(e.west,e.south,0,R[3]);let a=0,n=0,i=0,r=0;const s=z._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let a=0;a<4;++a){const t=R[a];if(N.positionToTileXY(t,o,D),0===a)i=D.x,r=D.y;else if(i!==D.x||r!==D.y){e=!0;break}}if(e)break;a=i,n=r}if(0!==o)return{x:a,y:n,level:o>s?s:o-1}}z.initialize=function(){let e=z._initPromise;return r.defined(e)||(e=c.Resource.fetchJson(a.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){z._terrainHeights=e})),z._initPromise=e),e},z.getMinimumMaximumHeights=function(e,a){a=r.defaultValue(a,t.Ellipsoid.WGS84);const i=H(e);let s=z._defaultMinTerrainHeight,c=z._defaultMaxTerrainHeight;if(r.defined(i)){const t=`${i.level}-${i.x}-${i.y}`,l=z._terrainHeights[t];r.defined(l)&&(s=l[0],c=l[1]),a.cartographicToCartesian(o.Rectangle.northeast(e,A),b),a.cartographicToCartesian(o.Rectangle.southwest(e,A),O),n.Cartesian3.midpoint(O,b,x);const u=a.scaleToGeodeticSurface(x,I);if(r.defined(u)){const e=n.Cartesian3.distance(x,u);s=Math.min(s,-e)}else s=z._defaultMinTerrainHeight}return s=Math.max(z._defaultMinTerrainHeight,s),{minimumTerrainHeight:s,maximumTerrainHeight:c}},z.getBoundingSphere=function(a,n){n=r.defaultValue(n,t.Ellipsoid.WGS84);const i=H(a);let s=z._defaultMaxTerrainHeight;if(r.defined(i)){const e=`${i.level}-${i.x}-${i.y}`,a=z._terrainHeights[e];r.defined(a)&&(s=a[1])}const o=e.BoundingSphere.fromRectangle3D(a,n,0);return e.BoundingSphere.fromRectangle3D(a,n,s,L),e.BoundingSphere.union(o,L,o)},z._terrainHeightsMaxLevel=6,z._defaultMaxTerrainHeight=9e3,z._defaultMinTerrainHeight=-1e5,z._terrainHeights=void 0,z._initPromise=void 0,Object.defineProperties(z,{initialized:{get:function(){return r.defined(z._terrainHeights)}}});const B=[g.GeographicProjection,M.WebMercatorProjection],G=B.length,j=Math.cos(w.CesiumMath.toRadians(30)),V=Math.cos(w.CesiumMath.toRadians(150));function F(e){const a=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).positions;this.width=r.defaultValue(e.width,1),this._positions=a,this.granularity=r.defaultValue(e.granularity,9999),this.loop=r.defaultValue(e.loop,!1),this.arcType=r.defaultValue(e.arcType,l.ArcType.GEODESIC),this._ellipsoid=t.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(F.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+t.Ellipsoid.packedLength+1+1}}}),F.setProjectionAndEllipsoid=function(e,a){let t=0;for(let e=0;e<G;e++)if(a instanceof B[e]){t=e;break}e._projectionIndex=t,e._ellipsoid=a.ellipsoid};const q=new n.Cartesian3,v=new n.Cartesian3,W=new n.Cartesian3;function U(e,a,t,i,r){const s=K(i,e,0,q),o=K(i,e,t,v),c=K(i,a,0,W),l=ee(o,s,v),u=ee(c,s,W);return n.Cartesian3.cross(u,l,r),n.Cartesian3.normalize(r,r)}const Y=new t.Cartographic,$=new n.Cartesian3,Z=new n.Cartesian3,Q=new