数字孪生Web 后台dt( digital twin)2.0版本 统一命名格式
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
18 KiB

12 months ago
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./EncodedCartesian3-4930ae29","./IntersectionTests-8371bf29","./Plane-929e0674","./WebMercatorProjection-a8c0125a","./arrayRemoveDuplicates-4dfa28d2","./ArcType-2b58731c","./EllipsoidRhumbLine-8c93f67a","./EllipsoidGeodesic-19b1a191"],function(j,e,He,Be,je,a,t,Ge,Ve,Ye,G,i,n,V,Y,F,E){"use strict";function r(e){e=j.defaultValue(e,j.defaultValue.EMPTY_OBJECT),this._ellipsoid=j.defaultValue(e.ellipsoid,Be.Ellipsoid.WGS84),this._rectangle=j.defaultValue(e.rectangle,Be.Rectangle.MAX_VALUE),this._projection=new je.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=j.defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=j.defaultValue(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),r.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},r.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},r.prototype.rectangleToNativeRectangle=function(e,a){var t=He.CesiumMath.toDegrees(e.west),n=He.CesiumMath.toDegrees(e.south),r=He.CesiumMath.toDegrees(e.east),i=He.CesiumMath.toDegrees(e.north);return j.defined(a)?(a.west=t,a.south=n,a.east=r,a.north=i,a):new Be.Rectangle(t,n,r,i)},r.prototype.tileXYToNativeRectangle=function(e,a,t,n){var r=this.tileXYToRectangle(e,a,t,n);return r.west=He.CesiumMath.toDegrees(r.west),r.south=He.CesiumMath.toDegrees(r.south),r.east=He.CesiumMath.toDegrees(r.east),r.north=He.CesiumMath.toDegrees(r.north),r},r.prototype.tileXYToRectangle=function(e,a,t,n){var r=this._rectangle,i=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),o=r.width/i,l=e*o+r.west,u=(e+1)*o+r.west,c=r.height/s,C=r.north-a*c,p=r.north-(a+1)*c;return j.defined(n)||(n=new Be.Rectangle(l,p,u,C)),n.west=l,n.south=p,n.east=u,n.north=C,n},r.prototype.positionToTileXY=function(e,a,t){var n=this._rectangle;if(Be.Rectangle.contains(n,e)){var r=this.getNumberOfXTilesAtLevel(a),i=this.getNumberOfYTilesAtLevel(a),s=n.width/r,o=n.height/i,l=e.longitude;n.east<n.west&&(l+=He.CesiumMath.TWO_PI);var u=(l-n.west)/s|0;r<=u&&(u=r-1);var c=(n.north-e.latitude)/o|0;return i<=c&&(c=i-1),j.defined(t)?(t.x=u,t.y=c,t):new Be.Cartesian2(u,c)}};var u=new Be.Cartesian3,c=new Be.Cartesian3,C=new Be.Cartographic,p=new Be.Cartesian3,h=new Be.Cartesian3,o=new je.BoundingSphere,d=new r,g=[new Be.Cartographic,new Be.Cartographic,new Be.Cartographic,new Be.Cartographic],f=new Be.Cartesian2,Fe={};function m(e){Be.Cartographic.fromRadians(e.east,e.north,0,g[0]),Be.Cartographic.fromRadians(e.west,e.north,0,g[1]),Be.Cartographic.fromRadians(e.east,e.south,0,g[2]),Be.Cartographic.fromRadians(e.west,e.south,0,g[3]);var a,t=0,n=0,r=0,i=0,s=Fe._terrainHeightsMaxLevel;for(a=0;a<=s;++a){for(var o=!1,l=0;l<4;++l){var u=g[l];if(d.positionToTileXY(u,a,f),0===l)r=f.x,i=f.y;else if(r!==f.x||i!==f.y){o=!0;break}}if(o)break;t=r,n=i}if(0!==a)return{x:t,y:n,level:s<a?s:a-1}}Fe.initialize=function(){var e=Fe._initPromise;return j.defined(e)?e:(e=je.Resource.fetchJson(je.buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){Fe._terrainHeights=e}),Fe._initPromise=e)},Fe.getMinimumMaximumHeights=function(e,a){a=j.defaultValue(a,Be.Ellipsoid.WGS84);var t=m(e),n=Fe._defaultMinTerrainHeight,r=Fe._defaultMaxTerrainHeight;if(j.defined(t)){var i=t.level+"-"+t.x+"-"+t.y,s=Fe._terrainHeights[i];j.defined(s)&&(n=s[0],r=s[1]),a.cartographicToCartesian(Be.Rectangle.northeast(e,C),u),a.cartographicToCartesian(Be.Rectangle.southwest(e,C),c),Be.Cartesian3.midpoint(c,u,p);var o=a.scaleToGeodeticSurface(p,h);if(j.defined(o)){var l=Be.Cartesian3.distance(p,o);n=Math.min(n,-l)}else n=Fe._defaultMinTerrainHeight}return{minimumTerrainHeight:n=Math.max(Fe._defaultMinTerrainHeight,n