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.

27 lines
12 KiB

4 weeks ago
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.128
*
* 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 R}from"./chunk-VC6LC2YG.js";import{a as ct}from"./chunk-YJ35UC5O.js";import{a as Z,b as H}from"./chunk-NPSDV7TS.js";import{a as V}from"./chunk-7MDSSANJ.js";import{a as U}from"./chunk-MWHUXN6D.js";import{b as ot}from"./chunk-YTKWBMG6.js";import{a as it}from"./chunk-OIUXC5BJ.js";import{a as nt}from"./chunk-CFEBEP3P.js";import{a as et}from"./chunk-MEQTML24.js";import{b as J,c as X,d as z}from"./chunk-D2WGDEJE.js";import{f as K}from"./chunk-GSQ5TTBU.js";import{a as k}from"./chunk-MCJA36VG.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-KLDIEE7M.js";import{a as I}from"./chunk-BF7B4FIR.js";import{e as x}from"./chunk-GDY26PU3.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;