mars3d-cesium
Advanced tools
Comparing version 1.93.0 to 1.94.0
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";const{Array:t,Object:e,Math:n,Error:s,Uint8Array:a,Uint16Array:r,Uint32Array:i,Int32Array:c,DataView:o,TextEncoder:l,crypto:h,postMessage:p}=globalThis,d=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;d[t]=e}class u{constructor(t){this.crc=t||-1}append(t){let e=0|this.crc;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^d[255&(e^t[n])];this.crc=e}get(){return~this.crc}}const f={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=f.getPartial(n);return 32===s?t.concat(e):f._shiftRight(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+f.getPartial(n)},clamp(t,e){if(32*t.length<e)return t;const s=(t=t.slice(0,n.ceil(e/32))).length;return e&=31,s>0&&e&&(t[s-1]=f.partial(e,t[s-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>n.round(t/1099511627776)||32,_shiftRight(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let a=0;a<t.length;a++)s.push(n|t[a]>>>e),n=t[a]<<32-e;const a=t.length?t[t.length-1]:0,r=f.getPartial(a);return s.push(f.partial(e+r&31,e+r>32?n:s.pop(),1)),s}},g={bytes:{fromBits(t){const e=f.bitLength(t)/8,n=new a(e);let s;for(let a=0;e>a;a++)0==(3&a)&&(s=t[a/4]),n[a]=s>>>24,s<<=8;return n},toBits(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3==(3&n)&&(e.push(s),s=0);return 3&n&&e.push(f.partial(8*(3&n),s)),e}}},w={sha1:function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()}};w.sha1.prototype={blockSize:512,reset:function(){const t=this;return t._h=this._init.slice(0),t._buffer=[],t._length=0,t},update:function(t){const e=this;"string"==typeof t&&(t=g.utf8String.toBits(t));const n=e._buffer=f.concat(e._buffer,t),a=e._length,r=e._length=a+f.bitLength(t);if(r>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const c=new i(n);let o=0;for(let t=e.blockSize+a-(e.blockSize+a&e.blockSize-1);r>=t;t+=e.blockSize)e._block(c.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e},finalize:function(){const t=this;let e=t._buffer;const s=t._h;e=f.concat(e,[f.partial(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(n.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(t,e,n,s)=>t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s,_S:(t,e)=>e<<t|e>>>32-t,_block:function(e){const s=this,a=s._h,r=t(80);for(let t=0;16>t;t++)r[t]=e[t];let i=a[0],c=a[1],o=a[2],l=a[3],h=a[4];for(let t=0;79>=t;t++){16>t||(r[t]=s._S(1,r[t-3]^r[t-8]^r[t-14]^r[t-16]));const e=s._S(5,i)+s._f(t,c,o,l)+h+r[t]+s._key[n.floor(t/20)]|0;h=l,l=o,o=s._S(30,c),c=i,i=e}a[0]=a[0]+i|0,a[1]=a[1]+c|0,a[2]=a[2]+o|0,a[3]=a[3]+l|0,a[4]=a[4]+h|0}};const y="Invalid pasword",_=16,m={name:"PBKDF2"},b=e.assign({hash:{name:"HMAC"}},m),k=e.assign({iterations:1e3,hash:{name:"SHA-1"}},m),z=["deriveBits"],C=[8,12,16],v=[16,24,32],I=10,S=[0,0,0,0],D=g.bytes,B=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],a=e._tables[1],r=t.length;let i,c,o,l=1;if(4!==r&&6!==r&&8!==r)throw new s("invalid aes key size");for(e._key=[c=t.slice(0),o=[]],i=r;4*r+28>i;i++){let t=c[i-1];(i%r==0||8===r&&i%r==4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%r==0&&(t=t<<8^t>>>24^l<<24,l=l<<1^283*(l>>7))),c[i]=c[i-r]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];o[t]=4>=i||4>t?e:a[0][n[e>>>24]]^a[1][n[e>>16&255]]^a[2][n[e>>8&255]]^a[3][n[255&e]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],a=[],r=[];let i,c,o,l;for(let t=0;256>t;t++)r[(a[t]=t<<1^283*(t>>7))^t]=t;for(let h=i=0;!n[h];h^=c||1,i=r[i]||1){let r=i^i<<1^i<<2^i<<3^i<<4;r=r>>8^255&r^99,n[h]=r,s[r]=h,l=a[o=a[c=a[h]]];let p=16843009*l^65537*o^257*c^16843008*h,d=257*a[r]^16843008*r;for(let n=0;4>n;n++)t[n][h]=d=d<<24^d>>>8,e[n][r]=p=p<<24^p>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}_crypt(t,e){if(4!==t.length)throw new s("invalid aes block size");const n=this._key[e],a=n.length/4-2,r=[0,0,0,0],i=this._tables[e],c=i[0],o=i[1],l=i[2],h=i[3],p=i[4];let d,u,f,g=t[0]^n[0],w=t[e?3:1]^n[1],y=t[2]^n[2],_=t[e?1:3]^n[3],m=4;for(let t=0;a>t;t++)d=c[g>>>24]^o[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],u=c[w>>>24]^o[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],f=c[y>>>24]^o[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=c[_>>>24]^o[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=d,w=u,y=f;for(let t=0;4>t;t++)r[e?3&-t:t]=p[g>>>24]<<24^p[w>>16&255]<<16^p[y>>8&255]<<8^p[255&_]^n[m++],d=g,g=w,w=y,y=_,_=d;return r}},H=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255==(t>>24&255)){let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}else t+=1<<24;return t}incCounter(t){0===(t[0]=this.incWord(t[0]))&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const a=f.bitLength(e);for(let a=0;s>a;a+=4){this.incCounter(n);const s=t.encrypt(n);e[a]^=s[0],e[a+1]^=s[1],e[a+2]^=s[2],e[a+3]^=s[3]}return f.clamp(e,a)}},V=class{constructor(t){const e=this,n=e._hash=w.sha1,s=[[],[]],a=n.prototype.blockSize/32;e._baseHash=[new n,new n],t.length>a&&(t=n.hash(t));for(let e=0;a>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}};class A{constructor(t,n,s){e.assign(this,{password:t,signed:n,strength:s-1,pendingInput:new a(0)})}async append(e){const n=this;if(n.password){const a=G(e,0,C[n.strength]+2);await(async(t,e,n)=>{await T(t,n,G(e,0,C[t.strength]));const a=G(e,C[t.strength]),r=t.keys.passwordVerification;if(r[0]!=a[0]||r[1]!=a[1])throw new s(y)})(n,a,n.password),n.password=null,n.aesCtrGladman=new H(new B(n.keys.key),t.from(S)),n.hmac=new V(n.keys.authentication),e=G(e,C[n.strength]+2)}return W(n,e,new a(e.length-I-(e.length-I)%_),0,I,!0)}flush(){const t=this,e=t.pendingInput,n=G(e,0,e.length-I),s=G(e,e.length-I);let r=new a(0);if(n.length){const e=D.toBits(n);t.hmac.update(e);const s=t.aesCtrGladman.update(e);r=D.fromBits(s)}let i=!0;if(t.signed){const e=G(D.fromBits(t.hmac.digest()),0,I);for(let t=0;I>t;t++)e[t]!=s[t]&&(i=!1)}return{valid:i,data:r}}}class K{constructor(t,n){e.assign(this,{password:t,strength:n-1,pendingInput:new a(0)})}async append(e){const n=this;let s=new a(0);n.password&&(s=await(async(t,e)=>{const n=h.getRandomValues(new a(C[t.strength]));return await T(t,e,n),U(n,t.keys.passwordVerification)})(n,n.password),n.password=null,n.aesCtrGladman=new H(new B(n.keys.key),t.from(S)),n.hmac=new V(n.keys.authentication));const r=new a(s.length+e.length-e.length%_);return r.set(s,0),W(n,e,r,s.length,0)}flush(){const t=this;let e=new a(0);if(t.pendingInput.length){const n=t.aesCtrGladman.update(D.toBits(t.pendingInput));t.hmac.update(n),e=D.fromBits(n)}const n=G(D.fromBits(t.hmac.digest()),0,I);return{data:U(e,n),signature:n}}}function W(t,e,n,s,r,i){const c=e.length-r;let o;for(t.pendingInput.length&&(e=U(t.pendingInput,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new a(e)).set(n,0)}return t})(n,c-c%_)),o=0;c-_>=o;o+=_){const a=D.toBits(G(e,o,o+_));i&&t.hmac.update(a);const r=t.aesCtrGladman.update(a);i||t.hmac.update(r),n.set(D.fromBits(r),o+s)}return t.pendingInput=G(e,o),n}async function T(t,n,s){const r=(t=>{if(void 0===l){const e=new a((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new l).encode(t)})(n),i=await h.subtle.importKey("raw",r,b,!1,z),c=await h.subtle.deriveBits(e.assign({salt:s},k),i,8*(2*v[t.strength]+2)),o=new a(c);t.keys={key:D.toBits(G(o,0,v[t.strength])),authentication:D.toBits(G(o,v[t.strength],2*v[t.strength])),passwordVerification:G(o,2*v[t.strength])}}function U(t,e){let n=t;return t.length+e.length&&(n=new a(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function G(t,e,n){return t.subarray(e,n)}class L{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),M(this,t)}append(t){const e=this;if(e.password){const n=R(e,t.subarray(0,12));if(e.password=null,n[11]!=e.passwordVerification)throw new s(y);t=t.subarray(12)}return R(e,t)}flush(){return{valid:!0,data:new a(0)}}}class P{constructor(t,n){e.assign(this,{password:t,passwordVerification:n}),M(this,t)}append(t){const e=this;let n,s;if(e.password){e.password=null;const r=h.getRandomValues(new a(12));r[11]=e.passwordVerification,n=new a(t.length+r.length),n.set(E(e,r),0),s=12}else n=new a(t.length),s=0;return n.set(E(e,t),s),n}flush(){return{data:new a(0)}}}function R(t,e){const n=new a(e.length);for(let s=0;s<e.length;s++)n[s]=x(t)^e[s],j(t,n[s]);return n}function E(t,e){const n=new a(e.length);for(let s=0;s<e.length;s++)n[s]=x(t)^e[s],j(t,e[s]);return n}function M(t,e){t.keys=[305419896,591751049,878082192],t.crcKey0=new u(t.keys[0]),t.crcKey2=new u(t.keys[2]);for(let n=0;n<e.length;n++)j(t,e.charCodeAt(n))}function j(t,e){t.crcKey0.append([e]),t.keys[0]=~t.crcKey0.get(),t.keys[1]=O(t.keys[1]+F(t.keys[0])),t.keys[1]=O(n.imul(t.keys[1],134775813)+1),t.crcKey2.append([t.keys[1]>>>24]),t.keys[2]=~t.crcKey2.get()}function x(t){const e=2|t.keys[2];return F(n.imul(e,1^e)>>>8)}function F(t){return 255&t}function O(t){return 4294967295&t}const q="deflate",J="inflate",N="Invalid signature";class Q{constructor(t,{signature:n,password:s,signed:a,compressed:r,zipCrypto:i,passwordVerification:c,encryptionStrength:o},{chunkSize:l}){const h=!!s;e.assign(this,{signature:n,encrypted:h,signed:a,compressed:r,inflate:r&&new t({chunkSize:l}),crc32:a&&new u,zipCrypto:i,decrypt:h&&i?new L(s,c):new A(s,a,o)})}async append(t){const e=this;return e.encrypted&&t.length&&(t=await e.decrypt.append(t)),e.compressed&&t.length&&(t=await e.inflate.append(t)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),t}async flush(){const t=this;let e,n=new a(0);if(t.encrypted){const e=t.decrypt.flush();if(!e.valid)throw new s(N);n=e.data}if((!t.encrypted||t.zipCrypto)&&t.signed){const n=new o(new a(4).buffer);if(e=t.crc32.get(),n.setUint32(0,e),t.signature!=n.getUint32(0,!1))throw new s(N)}return t.compressed&&(n=await t.inflate.append(n)||new a(0),await t.inflate.flush()),{data:n,signature:e}}}class X{constructor(t,{encrypted:n,signed:s,compressed:a,level:r,zipCrypto:i,password:c,passwordVerification:o,encryptionStrength:l},{chunkSize:h}){e.assign(this,{encrypted:n,signed:s,compressed:a,deflate:a&&new t({level:r||5,chunkSize:h}),crc32:s&&new u,zipCrypto:i,encrypt:n&&i?new P(c,o):new K(c,l)})}async append(t){const e=this;let n=t;return e.compressed&&t.length&&(n=await e.deflate.append(t)),e.encrypted&&n.length&&(n=await e.encrypt.append(n)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),n}async flush(){const t=this;let e,n=new a(0);if(t.compressed&&(n=await t.deflate.flush()||new a(0)),t.encrypted){n=await t.encrypt.append(n);const s=t.encrypt.flush();e=s.signature;const r=new a(n.length+s.data.length);r.set(n,0),r.set(s.data,n.length),n=r}return t.encrypted&&!t.zipCrypto||!t.signed||(e=t.crc32.get()),{data:n,signature:e}}}const Y={init(t){t.scripts&&t.scripts.length&&importScripts.apply(void 0,t.scripts);const e=t.options;let n;self.initCodec&&self.initCodec(),e.codecType.startsWith(q)?n=self.Deflate:e.codecType.startsWith(J)&&(n=self.Inflate),Z=((t,e,n)=>e.codecType.startsWith(q)?new X(t,e,n):e.codecType.startsWith(J)?new Q(t,e,n):void 0)(n,e,t.config)},append:async t=>({data:await Z.append(t.data)}),flush:()=>Z.flush()};let Z;function $(t,n,s){return class{constructor(r){const i=this;i.codec=new t(e.assign({},n,r)),s(i.codec,(t=>{if(i.pendingData){const e=i.pendingData;i.pendingData=new a(e.length+t.length),i.pendingData.set(e,0),i.pendingData.set(t,e.length)}else i.pendingData=new a(t)}))}async append(t){return this.codec.push(t),r(this)}async flush(){return this.codec.push(new a(0),!0),r(this)}};function r(t){if(t.pendingData){const e=t.pendingData;return t.pendingData=null,e}return new a(0)}}addEventListener("message",(async t=>{const e=t.data,n=e.type,s=Y[n];if(s)try{e.data&&(e.data=new a(e.data));const t=await s(e)||{};if(t.type=n,t.data)try{t.data=t.data.buffer,p(t,[t.data])}catch(e){p(t)}else p(t)}catch(t){p({type:n,error:{message:t.message,stack:t.stack}})}})),self.initCodec=()=>{const{Deflate:t,Inflate:e}=((t,e={},n)=>({Deflate:$(t.Deflate,e.deflate,n),Inflate:$(t.Inflate,e.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((t,e)=>t.onData=e));self.Deflate=t,self.Inflate=e}}(); | ||
!function(){"use strict";const t=[];for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)1&n?n=n>>>1^3988292384:n>>>=1;t[e]=n}class e{constructor(t){this.crc=t||-1}append(e){let n=0|this.crc;for(let s=0,r=0|e.length;s<r;s++)n=n>>>8^t[255&(n^e[s])];this.crc=n}get(){return~this.crc}}const n={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const s=t[t.length-1],r=n.getPartial(s);return 32===r?t.concat(e):n._shiftRight(e,r,0|s,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const s=t[e-1];return 32*(e-1)+n.getPartial(s)},clamp(t,e){if(32*t.length<e)return t;const s=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,s>0&&e&&(t[s-1]=n.partial(e,t[s-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>Math.round(t/1099511627776)||32,_shiftRight(t,e,s,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(s),s=0;if(0===e)return r.concat(t);for(let n=0;n<t.length;n++)r.push(s|t[n]>>>e),s=t[n]<<32-e;const a=t.length?t[t.length-1]:0,i=n.getPartial(a);return r.push(n.partial(e+i&31,e+i>32?s:r.pop(),1)),r}},s={bytes:{fromBits(t){const e=n.bitLength(t)/8,s=new Uint8Array(e);let r;for(let n=0;n<e;n++)0==(3&n)&&(r=t[n/4]),s[n]=r>>>24,r<<=8;return s},toBits(t){const e=[];let s,r=0;for(s=0;s<t.length;s++)r=r<<8|t[s],3==(3&s)&&(e.push(r),r=0);return 3&s&&e.push(n.partial(8*(3&s),r)),e}}},r={sha1:function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()}};r.sha1.prototype={blockSize:512,reset:function(){const t=this;return t._h=this._init.slice(0),t._buffer=[],t._length=0,t},update:function(t){const e=this;"string"==typeof t&&(t=s.utf8String.toBits(t));const r=e._buffer=n.concat(e._buffer,t),a=e._length,i=e._length=a+n.bitLength(t);if(i>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const c=new Uint32Array(r);let o=0;for(let t=e.blockSize+a-(e.blockSize+a&e.blockSize-1);t<=i;t+=e.blockSize)e._block(c.subarray(16*o,16*(o+1))),o+=1;return r.splice(0,16*o),e},finalize:function(){const t=this;let e=t._buffer;const s=t._h;e=n.concat(e,[n.partial(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(t,e,n,s){return t<=19?e&n|~e&s:t<=39?e^n^s:t<=59?e&n|e&s|n&s:t<=79?e^n^s:void 0},_S:function(t,e){return e<<t|e>>>32-t},_block:function(t){const e=this,n=e._h,s=Array(80);for(let e=0;e<16;e++)s[e]=t[e];let r=n[0],a=n[1],i=n[2],c=n[3],o=n[4];for(let t=0;t<=79;t++){t>=16&&(s[t]=e._S(1,s[t-3]^s[t-8]^s[t-14]^s[t-16]));const n=e._S(5,r)+e._f(t,a,i,c)+o+s[t]+e._key[Math.floor(t/20)]|0;o=c,c=i,i=e._S(30,a),a=r,r=n}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+i|0,n[3]=n[3]+c|0,n[4]=n[4]+o|0}};const a=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],s=e._tables[1],r=t.length;let a,i,c,o=1;if(4!==r&&6!==r&&8!==r)throw new Error("invalid aes key size");for(e._key=[i=t.slice(0),c=[]],a=r;a<4*r+28;a++){let t=i[a-1];(a%r==0||8===r&&a%r==4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],a%r==0&&(t=t<<8^t>>>24^o<<24,o=o<<1^283*(o>>7))),i[a]=i[a-r]^t}for(let t=0;a;t++,a--){const e=i[3&t?a:a-4];c[t]=a<=4||t<4?e:s[0][n[e>>>24]]^s[1][n[e>>16&255]]^s[2][n[e>>8&255]]^s[3][n[255&e]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],r=[],a=[];let i,c,o,l;for(let t=0;t<256;t++)a[(r[t]=t<<1^283*(t>>7))^t]=t;for(let h=i=0;!n[h];h^=c||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[o=r[c=r[h]]];let p=16843009*l^65537*o^257*c^16843008*h,u=257*r[a]^16843008*a;for(let n=0;n<4;n++)t[n][h]=u=u<<24^u>>>8,e[n][a]=p=p<<24^p>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}_crypt(t,e){if(4!==t.length)throw new Error("invalid aes block size");const n=this._key[e],s=n.length/4-2,r=[0,0,0,0],a=this._tables[e],i=a[0],c=a[1],o=a[2],l=a[3],h=a[4];let p,u,d,f=t[0]^n[0],g=t[e?3:1]^n[1],y=t[2]^n[2],w=t[e?1:3]^n[3],_=4;for(let t=0;t<s;t++)p=i[f>>>24]^c[g>>16&255]^o[y>>8&255]^l[255&w]^n[_],u=i[g>>>24]^c[y>>16&255]^o[w>>8&255]^l[255&f]^n[_+1],d=i[y>>>24]^c[w>>16&255]^o[f>>8&255]^l[255&g]^n[_+2],w=i[w>>>24]^c[f>>16&255]^o[g>>8&255]^l[255&y]^n[_+3],_+=4,f=p,g=u,y=d;for(let t=0;t<4;t++)r[e?3&-t:t]=h[f>>>24]<<24^h[g>>16&255]<<16^h[y>>8&255]<<8^h[255&w]^n[_++],p=f,f=g,g=y,y=w,w=p;return r}},i=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255==(t>>24&255)){let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}else t+=1<<24;return t}incCounter(t){0===(t[0]=this.incWord(t[0]))&&(t[1]=this.incWord(t[1]))}calculate(t,e,s){let r;if(!(r=e.length))return[];const a=n.bitLength(e);for(let n=0;n<r;n+=4){this.incCounter(s);const r=t.encrypt(s);e[n]^=r[0],e[n+1]^=r[1],e[n+2]^=r[2],e[n+3]^=r[3]}return n.clamp(e,a)}},c=class{constructor(t){const e=this,n=e._hash=r.sha1,s=[[],[]],a=n.prototype.blockSize/32;e._baseHash=[new n,new n],t.length>a&&(t=n.hash(t));for(let e=0;e<a;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}},o="Invalid pasword",l=16,h={name:"PBKDF2"},p=Object.assign({hash:{name:"HMAC"}},h),u=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},h),d=["deriveBits"],f=[8,12,16],g=[16,24,32],y=10,w=[0,0,0,0],_=s.bytes,b=a,m=i,k=c;class A{constructor(t,e,n){Object.assign(this,{password:t,signed:e,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){const e=this;if(e.password){const n=S(t,0,f[e.strength]+2);await async function(t,e,n){await v(t,n,S(e,0,f[t.strength]));const s=S(e,f[t.strength]),r=t.keys.passwordVerification;if(r[0]!=s[0]||r[1]!=s[1])throw new Error(o)}(e,n,e.password),e.password=null,e.aesCtrGladman=new m(new b(e.keys.key),Array.from(w)),e.hmac=new k(e.keys.authentication),t=S(t,f[e.strength]+2)}return z(e,t,new Uint8Array(t.length-y-(t.length-y)%l),0,y,!0)}flush(){const t=this,e=t.pendingInput,n=S(e,0,e.length-y),s=S(e,e.length-y);let r=new Uint8Array(0);if(n.length){const e=_.toBits(n);t.hmac.update(e);const s=t.aesCtrGladman.update(e);r=_.fromBits(s)}let a=!0;if(t.signed){const e=S(_.fromBits(t.hmac.digest()),0,y);for(let t=0;t<y;t++)e[t]!=s[t]&&(a=!1)}return{valid:a,data:r}}}class U{constructor(t,e){Object.assign(this,{password:t,strength:e-1,pendingInput:new Uint8Array(0)})}async append(t){const e=this;let n=new Uint8Array(0);e.password&&(n=await async function(t,e){const n=crypto.getRandomValues(new Uint8Array(f[t.strength]));return await v(t,e,n),C(n,t.keys.passwordVerification)}(e,e.password),e.password=null,e.aesCtrGladman=new m(new b(e.keys.key),Array.from(w)),e.hmac=new k(e.keys.authentication));const s=new Uint8Array(n.length+t.length-t.length%l);return s.set(n,0),z(e,t,s,n.length,0)}flush(){const t=this;let e=new Uint8Array(0);if(t.pendingInput.length){const n=t.aesCtrGladman.update(_.toBits(t.pendingInput));t.hmac.update(n),e=_.fromBits(n)}const n=S(_.fromBits(t.hmac.digest()),0,y);return{data:C(e,n),signature:n}}}function z(t,e,n,s,r,a){const i=e.length-r;let c;for(t.pendingInput.length&&(e=C(t.pendingInput,e),n=function(t,e){if(e&&e>t.length){const n=t;(t=new Uint8Array(e)).set(n,0)}return t}(n,i-i%l)),c=0;c<=i-l;c+=l){const r=_.toBits(S(e,c,c+l));a&&t.hmac.update(r);const i=t.aesCtrGladman.update(r);a||t.hmac.update(i),n.set(_.fromBits(i),c+s)}return t.pendingInput=S(e,c),n}async function v(t,e,n){const s=(new TextEncoder).encode(e),r=await crypto.subtle.importKey("raw",s,p,!1,d),a=await crypto.subtle.deriveBits(Object.assign({salt:n},u),r,8*(2*g[t.strength]+2)),i=new Uint8Array(a);t.keys={key:_.toBits(S(i,0,g[t.strength])),authentication:_.toBits(S(i,g[t.strength],2*g[t.strength])),passwordVerification:S(i,2*g[t.strength])}}function C(t,e){let n=t;return t.length+e.length&&(n=new Uint8Array(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function S(t,e,n){return t.subarray(e,n)}class B{constructor(t,e){Object.assign(this,{password:t,passwordVerification:e}),V(this,t)}append(t){const e=this;if(e.password){const n=I(e,t.subarray(0,12));if(e.password=null,n[11]!=e.passwordVerification)throw new Error(o);t=t.subarray(12)}return I(e,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}}class D{constructor(t,e){Object.assign(this,{password:t,passwordVerification:e}),V(this,t)}append(t){const e=this;let n,s;if(e.password){e.password=null;const r=crypto.getRandomValues(new Uint8Array(12));r[11]=e.passwordVerification,n=new Uint8Array(t.length+r.length),n.set(H(e,r),0),s=12}else n=new Uint8Array(t.length),s=0;return n.set(H(e,t),s),n}flush(){return{data:new Uint8Array(0)}}}function I(t,e){const n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=j(t)^e[s],M(t,n[s]);return n}function H(t,e){const n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=j(t)^e[s],M(t,e[s]);return n}function V(t,n){t.keys=[305419896,591751049,878082192],t.crcKey0=new e(t.keys[0]),t.crcKey2=new e(t.keys[2]);for(let e=0;e<n.length;e++)M(t,n.charCodeAt(e))}function M(t,e){t.crcKey0.append([e]),t.keys[0]=~t.crcKey0.get(),t.keys[1]=E(t.keys[1]+O(t.keys[0])),t.keys[1]=E(Math.imul(t.keys[1],134775813)+1),t.crcKey2.append([t.keys[1]>>>24]),t.keys[2]=~t.crcKey2.get()}function j(t){const e=2|t.keys[2];return O(Math.imul(e,1^e)>>>8)}function O(t){return 255&t}function E(t){return 4294967295&t}const K="deflate",W="inflate",G="Invalid signature";class L{constructor(t,{signature:n,password:s,signed:r,compressed:a,zipCrypto:i,passwordVerification:c,encryptionStrength:o},{chunkSize:l}){const h=Boolean(s);Object.assign(this,{signature:n,encrypted:h,signed:r,compressed:a,inflate:a&&new t({chunkSize:l}),crc32:r&&new e,zipCrypto:i,decrypt:h&&i?new B(s,c):new A(s,r,o)})}async append(t){const e=this;return e.encrypted&&t.length&&(t=await e.decrypt.append(t)),e.compressed&&t.length&&(t=await e.inflate.append(t)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),t}async flush(){const t=this;let e,n=new Uint8Array(0);if(t.encrypted){const e=t.decrypt.flush();if(!e.valid)throw new Error(G);n=e.data}if((!t.encrypted||t.zipCrypto)&&t.signed){const n=new DataView(new Uint8Array(4).buffer);if(e=t.crc32.get(),n.setUint32(0,e),t.signature!=n.getUint32(0,!1))throw new Error(G)}return t.compressed&&(n=await t.inflate.append(n)||new Uint8Array(0),await t.inflate.flush()),{data:n,signature:e}}}class P{constructor(t,{encrypted:n,signed:s,compressed:r,level:a,zipCrypto:i,password:c,passwordVerification:o,encryptionStrength:l},{chunkSize:h}){Object.assign(this,{encrypted:n,signed:s,compressed:r,deflate:r&&new t({level:a||5,chunkSize:h}),crc32:s&&new e,zipCrypto:i,encrypt:n&&i?new D(c,o):new U(c,l)})}async append(t){const e=this;let n=t;return e.compressed&&t.length&&(n=await e.deflate.append(t)),e.encrypted&&n.length&&(n=await e.encrypt.append(n)),(!e.encrypted||e.zipCrypto)&&e.signed&&t.length&&e.crc32.append(t),n}async flush(){const t=this;let e,n=new Uint8Array(0);if(t.compressed&&(n=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){n=await t.encrypt.append(n);const s=t.encrypt.flush();e=s.signature;const r=new Uint8Array(n.length+s.data.length);r.set(n,0),r.set(s.data,n.length),n=r}return t.encrypted&&!t.zipCrypto||!t.signed||(e=t.crc32.get()),{data:n,signature:e}}}const T={init(t){t.scripts&&t.scripts.length&&importScripts.apply(void 0,t.scripts);const e=t.options;let n;self.initCodec&&self.initCodec(),e.codecType.startsWith(K)?n=self.Deflate:e.codecType.startsWith(W)&&(n=self.Inflate),R=function(t,e,n){return e.codecType.startsWith(K)?new P(t,e,n):e.codecType.startsWith(W)?new L(t,e,n):void 0}(n,e,t.config)},append:async t=>({data:await R.append(t.data)}),flush:()=>R.flush()};let R;function x(t,e,n){return class{constructor(s){const r=this;r.codec=new t(Object.assign({},e,s)),n(r.codec,(t=>{if(r.pendingData){const e=r.pendingData;r.pendingData=new Uint8Array(e.length+t.length),r.pendingData.set(e,0),r.pendingData.set(t,e.length)}else r.pendingData=new Uint8Array(t)}))}async append(t){return this.codec.push(t),s(this)}async flush(){return this.codec.push(new Uint8Array(0),!0),s(this)}};function s(t){if(t.pendingData){const e=t.pendingData;return t.pendingData=null,e}return new Uint8Array(0)}}addEventListener("message",(async t=>{const e=t.data,n=e.type,s=T[n];if(s)try{e.data&&(e.data=new Uint8Array(e.data));const t=await s(e)||{};if(t.type=n,t.data)try{t.data=t.data.buffer,postMessage(t,[t.data])}catch(e){postMessage(t)}else postMessage(t)}catch(t){postMessage({type:n,error:{message:t.message,stack:t.stack}})}})),self.initCodec=()=>{const{Deflate:t,Inflate:e}=((t,e={},n)=>({Deflate:x(t.Deflate,e.deflate,n),Inflate:x(t.Inflate,e.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((t,e)=>t.onData=e));self.Deflate=t,self.Inflate=e}}(); |
@@ -1,1 +0,1 @@ | ||
define(["./PrimitivePipeline-9bc85f23","./createTaskProcessorWorker","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryPipeline-311a1f9e","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./IndexDatatype-1cbc8622","./IntersectionTests-94cb8698","./Plane-042297c7","./WebMercatorProjection-50f5da31"],(function(e,t,i,r,n,o,a,c,s,m,b,f,u,P,p,l,d,y,G){"use strict";return t((function(t,i){const r=e.PrimitivePipeline.unpackCombineGeometryParameters(t),n=e.PrimitivePipeline.combineGeometry(r);return e.PrimitivePipeline.packCombineGeometryResults(n,i)}))})); | ||
define(["./PrimitivePipeline-8cf7c60b","./createTaskProcessorWorker","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryPipeline-20b6a6da","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./IndexDatatype-0b020dfb","./IntersectionTests-4547e13f","./Plane-faef0199","./WebMercatorProjection-7e95daf8"],(function(e,t,i,r,a,n,o,c,s,m,f,b,d,u,P,p,l,y,G){"use strict";return t((function(t,i){const r=e.PrimitivePipeline.unpackCombineGeometryParameters(t),a=e.PrimitivePipeline.combineGeometry(r);return e.PrimitivePipeline.packCombineGeometryResults(a,i)}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./BoxGeometry-769f040a","./defaultValue-69ee94f4","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-06c05e21","./Matrix2-e6265fb0","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd"],(function(e,t,r,o,a,n,f,m,c,u,i,s,b){"use strict";return function(r,o){return t.defined(o)&&(r=e.BoxGeometry.unpack(r,o)),e.BoxGeometry.createGeometry(r)}})); | ||
define(["./BoxGeometry-7949613c","./defaultValue-69ee94f4","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd"],(function(e,t,r,o,a,n,f,m,c,d,u,i,b){"use strict";return function(r,o){return t.defined(o)&&(r=e.BoxGeometry.unpack(r,o)),e.BoxGeometry.createGeometry(r)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,a,i,r,o,u,s,m,f){"use strict";const c=new n.Cartesian3;function p(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).minimum,a=e.maximum;this._min=n.Cartesian3.clone(t),this._max=n.Cartesian3.clone(a),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}p.fromDimensions=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(t,.5,new n.Cartesian3);return new p({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,offsetAttribute:e.offsetAttribute})},p.fromAxisAlignedBoundingBox=function(e){return new p({minimum:e.minimum,maximum:e.maximum})},p.packedLength=2*n.Cartesian3.packedLength+1,p.pack=function(e,t,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(e._min,t,a),n.Cartesian3.pack(e._max,t,a+n.Cartesian3.packedLength),t[a+2*n.Cartesian3.packedLength]=r.defaultValue(e._offsetAttribute,-1),t};const l=new n.Cartesian3,d=new n.Cartesian3,y={minimum:l,maximum:d,offsetAttribute:void 0};return p.unpack=function(e,t,a){t=r.defaultValue(t,0);const i=n.Cartesian3.unpack(e,t,l),o=n.Cartesian3.unpack(e,t+n.Cartesian3.packedLength,d),u=e[t+2*n.Cartesian3.packedLength];return r.defined(a)?(a._min=n.Cartesian3.clone(i,a._min),a._max=n.Cartesian3.clone(o,a._max),a._offsetAttribute=-1===u?void 0:u,a):(y.offsetAttribute=-1===u?void 0:u,new p(y))},p.createGeometry=function(a){const s=a._min,m=a._max;if(n.Cartesian3.equals(s,m))return;const f=new u.GeometryAttributes,p=new Uint16Array(24),l=new Float64Array(24);l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=m.x,l[4]=s.y,l[5]=s.z,l[6]=m.x,l[7]=m.y,l[8]=s.z,l[9]=s.x,l[10]=m.y,l[11]=s.z,l[12]=s.x,l[13]=s.y,l[14]=m.z,l[15]=m.x,l[16]=s.y,l[17]=m.z,l[18]=m.x,l[19]=m.y,l[20]=m.z,l[21]=s.x,l[22]=m.y,l[23]=m.z,f.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l}),p[0]=4,p[1]=5,p[2]=5,p[3]=6,p[4]=6,p[5]=7,p[6]=7,p[7]=4,p[8]=0,p[9]=1,p[10]=1,p[11]=2,p[12]=2,p[13]=3,p[14]=3,p[15]=0,p[16]=0,p[17]=4,p[18]=1,p[19]=5,p[20]=2,p[21]=6,p[22]=3,p[23]=7;const d=n.Cartesian3.subtract(m,s,c),y=.5*n.Cartesian3.magnitude(d);if(r.defined(a._offsetAttribute)){const t=l.length,n=new Uint8Array(t/3),r=a._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(n,r),f.applyOffset=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new o.Geometry({attributes:f,indices:p,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,y),offsetAttribute:a._offsetAttribute})},function(e,t){return r.defined(t)&&(e=p.unpack(e,t)),p.createGeometry(e)}})); | ||
define(["./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,a,i,r,o,u,s,m,f){"use strict";const c=new n.Cartesian3;function d(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).minimum,a=e.maximum;this._min=n.Cartesian3.clone(t),this._max=n.Cartesian3.clone(a),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}d.fromDimensions=function(e){const t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(t,.5,new n.Cartesian3);return new d({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,offsetAttribute:e.offsetAttribute})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*n.Cartesian3.packedLength+1,d.pack=function(e,t,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(e._min,t,a),n.Cartesian3.pack(e._max,t,a+n.Cartesian3.packedLength),t[a+2*n.Cartesian3.packedLength]=r.defaultValue(e._offsetAttribute,-1),t};const p=new n.Cartesian3,l=new n.Cartesian3,y={minimum:p,maximum:l,offsetAttribute:void 0};return d.unpack=function(e,t,a){t=r.defaultValue(t,0);const i=n.Cartesian3.unpack(e,t,p),o=n.Cartesian3.unpack(e,t+n.Cartesian3.packedLength,l),u=e[t+2*n.Cartesian3.packedLength];return r.defined(a)?(a._min=n.Cartesian3.clone(i,a._min),a._max=n.Cartesian3.clone(o,a._max),a._offsetAttribute=-1===u?void 0:u,a):(y.offsetAttribute=-1===u?void 0:u,new d(y))},d.createGeometry=function(a){const s=a._min,m=a._max;if(n.Cartesian3.equals(s,m))return;const f=new u.GeometryAttributes,d=new Uint16Array(24),p=new Float64Array(24);p[0]=s.x,p[1]=s.y,p[2]=s.z,p[3]=m.x,p[4]=s.y,p[5]=s.z,p[6]=m.x,p[7]=m.y,p[8]=s.z,p[9]=s.x,p[10]=m.y,p[11]=s.z,p[12]=s.x,p[13]=s.y,p[14]=m.z,p[15]=m.x,p[16]=s.y,p[17]=m.z,p[18]=m.x,p[19]=m.y,p[20]=m.z,p[21]=s.x,p[22]=m.y,p[23]=m.z,f.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;const l=n.Cartesian3.subtract(m,s,c),y=.5*n.Cartesian3.magnitude(l);if(r.defined(a._offsetAttribute)){const t=p.length,n=new Uint8Array(t/3),r=a._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(n,r),f.applyOffset=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new o.Geometry({attributes:f,indices:d,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,y),offsetAttribute:a._offsetAttribute})},function(e,t){return r.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./EllipseGeometry-43f9e5b7","./VertexFormat-e68722dd","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-2b119a38","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./IndexDatatype-1cbc8622","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,i,r,o,n,s,l,a,m,d,c,u,p,y,_,G,x,h,f,g){"use strict";function E(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).radius,o={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new r.EllipseGeometry(o),this._workerName="createCircleGeometry"}E.packedLength=r.EllipseGeometry.packedLength,E.pack=function(e,t,i){return r.EllipseGeometry.pack(e._ellipseGeometry,t,i)};const b=new r.EllipseGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),w={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new o.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return E.unpack=function(t,n,s){const l=r.EllipseGeometry.unpack(t,n,b);return w.center=e.Cartesian3.clone(l._center,w.center),w.ellipsoid=e.Ellipsoid.clone(l._ellipsoid,w.ellipsoid),w.height=l._height,w.extrudedHeight=l._extrudedHeight,w.granularity=l._granularity,w.vertexFormat=o.VertexFormat.clone(l._vertexFormat,w.vertexFormat),w.stRotation=l._stRotation,w.shadowVolume=l._shadowVolume,i.defined(s)?(w.semiMajorAxis=l._semiMajorAxis,w.semiMinorAxis=l._semiMinorAxis,s._ellipseGeometry=new r.EllipseGeometry(w),s):(w.radius=l._semiMajorAxis,new E(w))},E.createGeometry=function(e){return r.EllipseGeometry.createGeometry(e._ellipseGeometry)},E.createShadowVolume=function(e,t,i){const r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,s=t(r,n),l=i(r,n);return new E({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:s,height:l,vertexFormat:o.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(E.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(t,r){return i.defined(r)&&(t=E.unpack(t,r)),t._ellipseGeometry._center=e.Cartesian3.clone(t._ellipseGeometry._center),t._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(t._ellipseGeometry._ellipsoid),E.createGeometry(t)}})); | ||
define(["./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./EllipseGeometry-7f98d885","./VertexFormat-e68722dd","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-70ca3053","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./IndexDatatype-0b020dfb","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,i,r,o,n,s,a,l,d,m,c,u,p,y,_,G,x,f,h,g){"use strict";function E(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).radius,o={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new r.EllipseGeometry(o),this._workerName="createCircleGeometry"}E.packedLength=r.EllipseGeometry.packedLength,E.pack=function(e,t,i){return r.EllipseGeometry.pack(e._ellipseGeometry,t,i)};const b=new r.EllipseGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),w={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new o.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return E.unpack=function(t,n,s){const a=r.EllipseGeometry.unpack(t,n,b);return w.center=e.Cartesian3.clone(a._center,w.center),w.ellipsoid=e.Ellipsoid.clone(a._ellipsoid,w.ellipsoid),w.height=a._height,w.extrudedHeight=a._extrudedHeight,w.granularity=a._granularity,w.vertexFormat=o.VertexFormat.clone(a._vertexFormat,w.vertexFormat),w.stRotation=a._stRotation,w.shadowVolume=a._shadowVolume,i.defined(s)?(w.semiMajorAxis=a._semiMajorAxis,w.semiMinorAxis=a._semiMinorAxis,s._ellipseGeometry=new r.EllipseGeometry(w),s):(w.radius=a._semiMajorAxis,new E(w))},E.createGeometry=function(e){return r.EllipseGeometry.createGeometry(e._ellipseGeometry)},E.createShadowVolume=function(e,t,i){const r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,s=t(r,n),a=i(r,n);return new E({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:s,height:a,vertexFormat:o.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(E.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(t,r){return i.defined(r)&&(t=E.unpack(t,r)),t._ellipseGeometry._center=e.Cartesian3.clone(t._ellipseGeometry._center),t._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(t._ellipseGeometry._ellipsoid),E.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./EllipseOutlineGeometry-5a39395e","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-2b119a38","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622"],(function(e,i,t,r,l,n,s,o,a,u,c,m,d,p){"use strict";function y(e){const i=(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).radius,l={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new r.EllipseOutlineGeometry(l),this._workerName="createCircleOutlineGeometry"}y.packedLength=r.EllipseOutlineGeometry.packedLength,y.pack=function(e,i,t){return r.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,t)};const f=new r.EllipseOutlineGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),G={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return y.unpack=function(i,l,n){const s=r.EllipseOutlineGeometry.unpack(i,l,f);return G.center=e.Cartesian3.clone(s._center,G.center),G.ellipsoid=e.Ellipsoid.clone(s._ellipsoid,G.ellipsoid),G.height=s._height,G.extrudedHeight=s._extrudedHeight,G.granularity=s._granularity,G.numberOfVerticalLines=s._numberOfVerticalLines,t.defined(n)?(G.semiMajorAxis=s._semiMajorAxis,G.semiMinorAxis=s._semiMinorAxis,n._ellipseGeometry=new r.EllipseOutlineGeometry(G),n):(G.radius=s._semiMajorAxis,new y(G))},y.createGeometry=function(e){return r.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(i,r){return t.defined(r)&&(i=y.unpack(i,r)),i._ellipseGeometry._center=e.Cartesian3.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(i._ellipseGeometry._ellipsoid),y.createGeometry(i)}})); | ||
define(["./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./EllipseOutlineGeometry-a5a2b688","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-70ca3053","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb"],(function(e,i,t,r,l,n,s,o,a,u,d,c,m,p){"use strict";function y(e){const i=(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT)).radius,l={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new r.EllipseOutlineGeometry(l),this._workerName="createCircleOutlineGeometry"}y.packedLength=r.EllipseOutlineGeometry.packedLength,y.pack=function(e,i,t){return r.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,t)};const f=new r.EllipseOutlineGeometry({center:new e.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),G={center:new e.Cartesian3,radius:void 0,ellipsoid:e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return y.unpack=function(i,l,n){const s=r.EllipseOutlineGeometry.unpack(i,l,f);return G.center=e.Cartesian3.clone(s._center,G.center),G.ellipsoid=e.Ellipsoid.clone(s._ellipsoid,G.ellipsoid),G.height=s._height,G.extrudedHeight=s._extrudedHeight,G.granularity=s._granularity,G.numberOfVerticalLines=s._numberOfVerticalLines,t.defined(n)?(G.semiMajorAxis=s._semiMajorAxis,G.semiMinorAxis=s._semiMinorAxis,n._ellipseGeometry=new r.EllipseOutlineGeometry(G),n):(G.radius=s._semiMajorAxis,new y(G))},y.createGeometry=function(e){return r.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(i,r){return t.defined(r)&&(i=y.unpack(i,r)),i._ellipseGeometry._center=e.Cartesian3.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=e.Ellipsoid.clone(i._ellipseGeometry._ellipsoid),y.createGeometry(i)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./arrayRemoveDuplicates-fe254feb","./BoundingRectangle-00ff5b29","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./CoplanarPolygonGeometryLibrary-5f6be5a7","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonGeometryLibrary-a64b67ab","./PolygonPipeline-1015dc5c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./OrientedBoundingBox-0f36ec8f","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./ArcType-e1641d8d","./EllipsoidRhumbLine-94e77fa4"],(function(e,t,n,o,a,r,i,s,l,c,p,y,u,m,d,g,f,b,h,x,C,P,A,w,F,G,L,E){"use strict";const v=new o.Cartesian3,T=new t.BoundingRectangle,D=new o.Cartesian2,_=new o.Cartesian2,V=new o.Cartesian3,k=new o.Cartesian3,R=new o.Cartesian3,I=new o.Cartesian3,M=new o.Cartesian3,B=new o.Cartesian3,H=new n.Quaternion,O=new o.Matrix3,z=new o.Matrix3,S=new o.Cartesian3;function N(e,t,a,i,s,p,y,m){const g=e.positions;let f=d.PolygonPipeline.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);const b=u.IndexDatatype.createTypedArray(g.length,f.length);b.set(f);let h=O;if(0!==i){let e=n.Quaternion.fromAxisAngle(p,i,H);if(h=o.Matrix3.fromQuaternion(e,h),t.tangent||t.bitangent){e=n.Quaternion.fromAxisAngle(p,-i,H);const a=o.Matrix3.fromQuaternion(e,z);y=o.Cartesian3.normalize(o.Matrix3.multiplyByVector(a,y,y),y),t.bitangent&&(m=o.Cartesian3.normalize(o.Cartesian3.cross(p,y,m),m))}}else h=o.Matrix3.clone(o.Matrix3.IDENTITY,h);const x=_;t.st&&(x.x=a.x,x.y=a.y);const C=g.length,P=3*C,A=new Float64Array(P),w=t.normal?new Float32Array(P):void 0,F=t.tangent?new Float32Array(P):void 0,G=t.bitangent?new Float32Array(P):void 0,L=t.st?new Float32Array(2*C):void 0;let E=0,T=0,V=0,k=0,R=0;for(let e=0;e<C;e++){const n=g[e];if(A[E++]=n.x,A[E++]=n.y,A[E++]=n.z,t.st){const e=s(o.Matrix3.multiplyByVector(h,n,v),D);o.Cartesian2.subtract(e,x,e);const t=r.CesiumMath.clamp(e.x/a.width,0,1),i=r.CesiumMath.clamp(e.y/a.height,0,1);L[R++]=t,L[R++]=i}t.normal&&(w[T++]=p.x,w[T++]=p.y,w[T++]=p.z),t.tangent&&(F[k++]=y.x,F[k++]=y.y,F[k++]=y.z),t.bitangent&&(G[V++]=m.x,G[V++]=m.y,G[V++]=m.z)}const I=new c.GeometryAttributes;return t.position&&(I.position=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(I.normal=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),t.tangent&&(I.tangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:F})),t.bitangent&&(I.bitangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),t.st&&(I.st=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),new l.Geometry({attributes:I,indices:b,primitiveType:l.PrimitiveType.TRIANGLES})}function Q(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=s.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT);this._vertexFormat=g.VertexFormat.clone(n),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=o.Ellipsoid.clone(s.defaultValue(e.ellipsoid,o.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=m.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+g.VertexFormat.packedLength+o.Ellipsoid.packedLength+2}Q.fromPositions=function(e){return new Q({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},Q.pack=function(e,t,n){return n=s.defaultValue(n,0),n=m.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n),o.Ellipsoid.pack(e._ellipsoid,t,n),n+=o.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._stRotation,t[n]=e.packedLength,t};const j=o.Ellipsoid.clone(o.Ellipsoid.UNIT_SPHERE),U=new g.VertexFormat,Y={polygonHierarchy:{}};return Q.unpack=function(e,t,n){t=s.defaultValue(t,0);const a=m.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;const r=o.Ellipsoid.unpack(e,t,j);t+=o.Ellipsoid.packedLength;const i=g.VertexFormat.unpack(e,t,U);t+=g.VertexFormat.packedLength;const l=e[t++],c=e[t];return s.defined(n)||(n=new Q(Y)),n._polygonHierarchy=a,n._ellipsoid=o.Ellipsoid.clone(r,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(i,n._vertexFormat),n._stRotation=l,n.packedLength=c,n},Q.createGeometry=function(t){const a=t._vertexFormat,s=t._polygonHierarchy,c=t._stRotation;let d=s.positions;if(d=e.arrayRemoveDuplicates(d,o.Cartesian3.equalsEpsilon,!0),d.length<3)return;let g=V,f=k,b=R,h=M;const x=B;if(!i.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(d,I,h,x))return;if(g=o.Cartesian3.cross(h,x,g),g=o.Cartesian3.normalize(g,g),!o.Cartesian3.equalsEpsilon(I,o.Cartesian3.ZERO,r.CesiumMath.EPSILON6)){const e=t._ellipsoid.geodeticSurfaceNormal(I,S);o.Cartesian3.dot(g,e)<0&&(g=o.Cartesian3.negate(g,g),h=o.Cartesian3.negate(h,h))}const C=i.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(I,h,x),P=i.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(I,h,x);a.tangent&&(f=o.Cartesian3.clone(h,f)),a.bitangent&&(b=o.Cartesian3.clone(x,b));const A=m.PolygonGeometryLibrary.polygonsFromHierarchy(s,C,!1),w=A.hierarchy,F=A.polygons;if(0===w.length)return;d=w[0].outerRing;const G=n.BoundingSphere.fromPoints(d),L=m.PolygonGeometryLibrary.computeBoundingRectangle(g,P,d,c,T),E=[];for(let e=0;e<F.length;e++){const t=new p.GeometryInstance({geometry:N(F[e],a,L,c,P,g,f,b)});E.push(t)}const v=y.GeometryPipeline.combineInstances(E)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=u.IndexDatatype.createTypedArray(v.attributes.position.values.length/3,v.indices);const D=v.attributes;return a.position||delete D.position,new l.Geometry({attributes:D,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:G})},function(e,t){return s.defined(t)&&(e=Q.unpack(e,t)),Q.createGeometry(e)}})); | ||
define(["./arrayRemoveDuplicates-7d5d09a3","./BoundingRectangle-13e74a41","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./CoplanarPolygonGeometryLibrary-bc611400","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonGeometryLibrary-2a7b65e7","./PolygonPipeline-a182ab3c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./OrientedBoundingBox-966209b7","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./ArcType-e1641d8d","./EllipsoidRhumbLine-001b8738"],(function(e,t,n,o,a,r,i,s,l,c,y,p,d,u,m,g,b,f,C,h,x,P,A,L,w,G,F,v){"use strict";const E=new o.Cartesian3,_=new t.BoundingRectangle,T=new o.Cartesian2,k=new o.Cartesian2,D=new o.Cartesian3,V=new o.Cartesian3,R=new o.Cartesian3,H=new o.Cartesian3,I=new o.Cartesian3,M=new o.Cartesian3,B=new n.Quaternion,O=new o.Matrix3,z=new o.Matrix3,S=new o.Cartesian3;function N(e,t,a,i,y,p,u,g,b){const f=e.positions;let C=m.PolygonPipeline.triangulate(e.positions2D,e.holes);C.length<3&&(C=[0,1,2]);const h=d.IndexDatatype.createTypedArray(f.length,C.length);h.set(C);let x=O;if(0!==i){let e=n.Quaternion.fromAxisAngle(u,i,B);if(x=o.Matrix3.fromQuaternion(e,x),t.tangent||t.bitangent){e=n.Quaternion.fromAxisAngle(u,-i,B);const a=o.Matrix3.fromQuaternion(e,z);g=o.Cartesian3.normalize(o.Matrix3.multiplyByVector(a,g,g),g),t.bitangent&&(b=o.Cartesian3.normalize(o.Cartesian3.cross(u,g,b),b))}}else x=o.Matrix3.clone(o.Matrix3.IDENTITY,x);const P=k;t.st&&(P.x=a.x,P.y=a.y);const A=f.length,L=3*A,w=new Float64Array(L),G=t.normal?new Float32Array(L):void 0,F=t.tangent?new Float32Array(L):void 0,v=t.bitangent?new Float32Array(L):void 0,_=t.st?new Float32Array(2*A):void 0;let D=0,V=0,R=0,H=0,I=0;for(let e=0;e<A;e++){const n=f[e];if(w[D++]=n.x,w[D++]=n.y,w[D++]=n.z,t.st)if(s.defined(y)&&y.positions.length===A)_[I++]=y.positions[e].x,_[I++]=y.positions[e].y;else{const e=p(o.Matrix3.multiplyByVector(x,n,E),T);o.Cartesian2.subtract(e,P,e);const t=r.CesiumMath.clamp(e.x/a.width,0,1),i=r.CesiumMath.clamp(e.y/a.height,0,1);_[I++]=t,_[I++]=i}t.normal&&(G[V++]=u.x,G[V++]=u.y,G[V++]=u.z),t.tangent&&(F[H++]=g.x,F[H++]=g.y,F[H++]=g.z),t.bitangent&&(v[R++]=b.x,v[R++]=b.y,v[R++]=b.z)}const M=new c.GeometryAttributes;return t.position&&(M.position=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w})),t.normal&&(M.normal=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),t.tangent&&(M.tangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:F})),t.bitangent&&(M.bitangent=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),t.st&&(M.st=new l.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:_})),new l.Geometry({attributes:M,indices:h,primitiveType:l.PrimitiveType.TRIANGLES})}function Q(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,n=e.textureCoordinates,a=s.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT);this._vertexFormat=g.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=o.Ellipsoid.clone(s.defaultValue(e.ellipsoid,o.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=u.PolygonGeometryLibrary.computeHierarchyPackedLength(t,o.Cartesian3)+g.VertexFormat.packedLength+o.Ellipsoid.packedLength+(s.defined(n)?u.PolygonGeometryLibrary.computeHierarchyPackedLength(n,o.Cartesian2):1)+2}Q.fromPositions=function(e){return new Q({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates})},Q.pack=function(e,t,n){return n=s.defaultValue(n,0),n=u.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n,o.Cartesian3),o.Ellipsoid.pack(e._ellipsoid,t,n),n+=o.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._stRotation,s.defined(e._textureCoordinates)?n=u.PolygonGeometryLibrary.packPolygonHierarchy(e._textureCoordinates,t,n,o.Cartesian2):t[n++]=-1,t[n++]=e.packedLength,t};const j=o.Ellipsoid.clone(o.Ellipsoid.UNIT_SPHERE),U=new g.VertexFormat,Y={polygonHierarchy:{}};return Q.unpack=function(e,t,n){t=s.defaultValue(t,0);const a=u.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,o.Cartesian3);t=a.startingIndex,delete a.startingIndex;const r=o.Ellipsoid.unpack(e,t,j);t+=o.Ellipsoid.packedLength;const i=g.VertexFormat.unpack(e,t,U);t+=g.VertexFormat.packedLength;const l=e[t++],c=-1===e[t]?void 0:u.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,o.Cartesian2);s.defined(c)?(t=c.startingIndex,delete c.startingIndex):t++;const y=e[t++];return s.defined(n)||(n=new Q(Y)),n._polygonHierarchy=a,n._ellipsoid=o.Ellipsoid.clone(r,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(i,n._vertexFormat),n._stRotation=l,n._textureCoordinates=c,n.packedLength=y,n},Q.createGeometry=function(t){const a=t._vertexFormat,c=t._polygonHierarchy,m=t._stRotation,g=t._textureCoordinates,b=s.defined(g);let f=c.positions;if(f=e.arrayRemoveDuplicates(f,o.Cartesian3.equalsEpsilon,!0),f.length<3)return;let C=D,h=V,x=R,P=I;const A=M;if(!i.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(f,H,P,A))return;if(C=o.Cartesian3.cross(P,A,C),C=o.Cartesian3.normalize(C,C),!o.Cartesian3.equalsEpsilon(H,o.Cartesian3.ZERO,r.CesiumMath.EPSILON6)){const e=t._ellipsoid.geodeticSurfaceNormal(H,S);o.Cartesian3.dot(C,e)<0&&(C=o.Cartesian3.negate(C,C),P=o.Cartesian3.negate(P,P))}const L=i.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(H,P,A),w=i.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(H,P,A);a.tangent&&(h=o.Cartesian3.clone(P,h)),a.bitangent&&(x=o.Cartesian3.clone(A,x));const G=u.PolygonGeometryLibrary.polygonsFromHierarchy(c,b,L,!1),F=G.hierarchy,v=G.polygons,E=b?u.PolygonGeometryLibrary.polygonsFromHierarchy(g,!0,(function(e){return e}),!1).polygons:void 0;if(0===F.length)return;f=F[0].outerRing;const T=n.BoundingSphere.fromPoints(f),k=u.PolygonGeometryLibrary.computeBoundingRectangle(C,w,f,m,_),B=[];for(let e=0;e<v.length;e++){const t=new y.GeometryInstance({geometry:N(v[e],a,k,m,b?E[e]:void 0,w,C,h,x)});B.push(t)}const O=p.GeometryPipeline.combineInstances(B)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=d.IndexDatatype.createTypedArray(O.attributes.position.values.length/3,O.indices);const z=O.attributes;return a.position||delete z.position,new l.Geometry({attributes:z,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:T})},function(e,t){return s.defined(t)&&(e=Q.unpack(e,t)),Q.createGeometry(e)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./arrayRemoveDuplicates-fe254feb","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./CoplanarPolygonGeometryLibrary-5f6be5a7","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonGeometryLibrary-a64b67ab","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./OrientedBoundingBox-0f36ec8f","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./ArcType-e1641d8d","./EllipsoidRhumbLine-94e77fa4","./PolygonPipeline-1015dc5c"],(function(e,t,n,o,r,i,a,c,y,l,s,u,p,d,m,f,g,b,h,P,G,L,T,E,H,A){"use strict";function C(e){const t=e.length,n=new Float64Array(3*t),o=u.IndexDatatype.createTypedArray(t,2*t);let i=0,a=0;for(let r=0;r<t;r++){const c=e[r];n[i++]=c.x,n[i++]=c.y,n[i++]=c.z,o[a++]=r,o[a++]=(r+1)%t}const l=new y.GeometryAttributes({position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})});return new c.Geometry({attributes:l,indices:o,primitiveType:c.PrimitiveType.LINES})}function k(e){const t=(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=p.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+1}k.fromPositions=function(e){return new k({polygonHierarchy:{positions:(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).positions}})},k.pack=function(e,t,n){return n=a.defaultValue(n,0),t[n=p.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n)]=e.packedLength,t};const _={polygonHierarchy:{}};return k.unpack=function(e,t,n){t=a.defaultValue(t,0);const o=p.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;const r=e[t];return a.defined(n)||(n=new k(_)),n._polygonHierarchy=o,n.packedLength=r,n},k.createGeometry=function(o){const r=o._polygonHierarchy;let a=r.positions;if(a=e.arrayRemoveDuplicates(a,n.Cartesian3.equalsEpsilon,!0),a.length<3)return;if(!i.CoplanarPolygonGeometryLibrary.validOutline(a))return;const y=p.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!1);if(0===y.length)return;const u=[];for(let e=0;e<y.length;e++){const t=new l.GeometryInstance({geometry:C(y[e])});u.push(t)}const d=s.GeometryPipeline.combineInstances(u)[0],m=t.BoundingSphere.fromPoints(r.positions);return new c.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:m})},function(e,t){return a.defined(t)&&(e=k.unpack(e,t)),e._ellipsoid=n.Ellipsoid.clone(e._ellipsoid),k.createGeometry(e)}})); | ||
define(["./arrayRemoveDuplicates-7d5d09a3","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./CoplanarPolygonGeometryLibrary-bc611400","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonGeometryLibrary-2a7b65e7","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./OrientedBoundingBox-966209b7","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./ArcType-e1641d8d","./EllipsoidRhumbLine-001b8738","./PolygonPipeline-a182ab3c"],(function(e,t,n,o,r,i,a,y,c,l,s,u,p,d,m,f,g,b,h,P,G,L,C,T,E,H){"use strict";function A(e){const t=e.length,n=new Float64Array(3*t),o=u.IndexDatatype.createTypedArray(t,2*t);let i=0,a=0;for(let r=0;r<t;r++){const y=e[r];n[i++]=y.x,n[i++]=y.y,n[i++]=y.z,o[a++]=r,o[a++]=(r+1)%t}const l=new c.GeometryAttributes({position:new y.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})});return new y.Geometry({attributes:l,indices:o,primitiveType:y.PrimitiveType.LINES})}function k(e){const t=(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=p.PolygonGeometryLibrary.computeHierarchyPackedLength(t,n.Cartesian3)+1}k.fromPositions=function(e){return new k({polygonHierarchy:{positions:(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).positions}})},k.pack=function(e,t,o){return o=a.defaultValue(o,0),t[o=p.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,o,n.Cartesian3)]=e.packedLength,t};const _={polygonHierarchy:{}};return k.unpack=function(e,t,o){t=a.defaultValue(t,0);const r=p.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t,n.Cartesian3);t=r.startingIndex,delete r.startingIndex;const i=e[t];return a.defined(o)||(o=new k(_)),o._polygonHierarchy=r,o.packedLength=i,o},k.createGeometry=function(o){const r=o._polygonHierarchy;let a=r.positions;if(a=e.arrayRemoveDuplicates(a,n.Cartesian3.equalsEpsilon,!0),a.length<3)return;if(!i.CoplanarPolygonGeometryLibrary.validOutline(a))return;const c=p.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!1);if(0===c.length)return;const u=[];for(let e=0;e<c.length;e++){const t=new l.GeometryInstance({geometry:A(c[e])});u.push(t)}const d=s.GeometryPipeline.combineInstances(u)[0],m=t.BoundingSphere.fromPoints(r.positions);return new y.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:m})},function(e,t){return a.defined(t)&&(e=k.unpack(e,t)),e._ellipsoid=n.Ellipsoid.clone(e._ellipsoid),k.createGeometry(e)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./GeometryOffsetAttribute-4d39b441","./arrayRemoveDuplicates-fe254feb","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./PolylineVolumeGeometryLibrary-c9777b58","./CorridorGeometryLibrary-0cda5b97","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4"],(function(t,e,r,a,i,o,n,s,l,d,u,c,m,f,y,p,g,h,C,b,A,_,w,v){"use strict";const T=new a.Cartesian3,G=new a.Cartesian3,E=new a.Cartesian3,V=new a.Cartesian3,x=new a.Cartesian3,F=new a.Cartesian3,L=new a.Cartesian3,P=new a.Cartesian3;function N(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function D(t,e,r,i,o,n){const l=t.normals,d=t.tangents,u=t.bitangents,c=a.Cartesian3.normalize(a.Cartesian3.cross(r,e,L),L);n.normal&&s.CorridorGeometryLibrary.addAttribute(l,e,i,o),n.tangent&&s.CorridorGeometryLibrary.addAttribute(d,c,i,o),n.bitangent&&s.CorridorGeometryLibrary.addAttribute(u,r,i,o)}function M(t,e,r){const i=t.positions,n=t.corners,m=t.endPositions,f=t.lefts,y=t.normals,p=new u.GeometryAttributes;let g,h,C,b=0,A=0,_=0;for(h=0;h<i.length;h+=2)C=i[h].length-3,b+=C,_+=2*C,A+=i[h+1].length-3;for(b+=3,A+=3,h=0;h<n.length;h++){g=n[h];const t=n[h].leftPositions;l.defined(t)?(C=t.length,b+=C,_+=C):(C=n[h].rightPositions.length,A+=C,_+=C)}const w=l.defined(m);let v;w&&(v=m[0].length-3,b+=v,A+=v,v/=3,_+=6*v);const x=b+A,N=new Float64Array(x),M={normals:e.normal?new Float32Array(x):void 0,tangents:e.tangent?new Float32Array(x):void 0,bitangents:e.bitangent?new Float32Array(x):void 0};let O,I,S,R,k,H,z=0,B=x-1,U=T,Y=G;const W=v/2,q=c.IndexDatatype.createTypedArray(x/3,_);let j=0;if(w){H=E,k=V;const t=m[0];for(U=a.Cartesian3.fromArray(y,0,U),Y=a.Cartesian3.fromArray(f,0,Y),h=0;h<W;h++)H=a.Cartesian3.fromArray(t,3*(W-1-h),H),k=a.Cartesian3.fromArray(t,3*(W+h),k),s.CorridorGeometryLibrary.addAttribute(N,k,z),s.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}let J,K,Q=0,X=0,Z=i[Q++],$=i[Q++];for(N.set(Z,z),N.set($,B-$.length+1),Y=a.Cartesian3.fromArray(f,X,Y),C=$.length-3,h=0;h<C;h+=3)J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,h,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C-h,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;for(J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,C,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),X+=3,h=0;h<n.length;h++){let t;g=n[h];const o=g.leftPositions,d=g.rightPositions;let u,c,m=F,p=E,b=V;if(U=a.Cartesian3.fromArray(y,X,U),l.defined(o)){for(D(M,U,Y,void 0,B,e),B-=3,u=R,c=S,t=0;t<o.length/3;t++)m=a.Cartesian3.fromArray(o,3*t,m),q[j++]=u,q[j++]=c-t-1,q[j++]=c-t,s.CorridorGeometryLibrary.addAttribute(N,m,void 0,B),p=a.Cartesian3.fromArray(N,3*(c-t-1),p),b=a.Cartesian3.fromArray(N,3*u,b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),D(M,U,Y,void 0,B,e),B-=3;m=a.Cartesian3.fromArray(N,3*u,m),p=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*c,p),m,p),b=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*(c-t),b),m,b),Y=a.Cartesian3.normalize(a.Cartesian3.add(p,b,Y),Y),D(M,U,Y,z,void 0,e),z+=3}else{for(D(M,U,Y,z,void 0,e),z+=3,u=S,c=R,t=0;t<d.length/3;t++)m=a.Cartesian3.fromArray(d,3*t,m),q[j++]=u,q[j++]=c+t,q[j++]=c+t+1,s.CorridorGeometryLibrary.addAttribute(N,m,z),p=a.Cartesian3.fromArray(N,3*u,p),b=a.Cartesian3.fromArray(N,3*(c+t),b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),D(M,U,Y,z,void 0,e),z+=3;m=a.Cartesian3.fromArray(N,3*u,m),p=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*(c+t),p),m,p),b=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*c,b),m,b),Y=a.Cartesian3.normalize(a.Cartesian3.negate(a.Cartesian3.add(b,p,Y),Y),Y),D(M,U,Y,void 0,B,e),B-=3}for(Z=i[Q++],$=i[Q++],Z.splice(0,3),$.splice($.length-3,3),N.set(Z,z),N.set($,B-$.length+1),C=$.length-3,X+=3,Y=a.Cartesian3.fromArray(f,X,Y),t=0;t<$.length;t+=3)J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,t,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C-t,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;z-=3,B+=3}if(U=a.Cartesian3.fromArray(y,y.length-3,U),D(M,U,Y,z,B,e),w){z+=3,B-=3,H=E,k=V;const t=m[1];for(h=0;h<W;h++)H=a.Cartesian3.fromArray(t,3*(v-h-1),H),k=a.Cartesian3.fromArray(t,3*h,k),s.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),s.CorridorGeometryLibrary.addAttribute(N,k,z),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}if(p.position=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:N}),e.st){const t=new Float32Array(x/3*2);let e,r,a=0;if(w){b/=3,A/=3;const i=Math.PI/(v+1);let n;r=1/(b-v+1),e=1/(A-v+1);const s=v/2;for(h=s+1;h<v+1;h++)n=o.CesiumMath.PI_OVER_TWO+i*h,t[a++]=e*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=1;h<A-v+1;h++)t[a++]=h*e,t[a++]=0;for(h=v;h>s;h--)n=o.CesiumMath.PI_OVER_TWO-h*i,t[a++]=1-e*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=s;h>0;h--)n=o.CesiumMath.PI_OVER_TWO-i*h,t[a++]=1-r*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=b-v;h>0;h--)t[a++]=h*r,t[a++]=1;for(h=1;h<s+1;h++)n=o.CesiumMath.PI_OVER_TWO+i*h,t[a++]=r*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n))}else{for(b/=3,A/=3,r=1/(b-1),e=1/(A-1),h=0;h<A;h++)t[a++]=h*e,t[a++]=0;for(h=b;h>0;h--)t[a++]=(h-1)*r,t[a++]=1}p.st=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}return e.normal&&(p.normal=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.normals})),e.tangent&&(p.tangent=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.tangents})),e.bitangent&&(p.bitangent=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.bitangents})),{attributes:p,indices:q}}function O(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(let a=3;a<t.length;a+=3){const i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function I(e,r){const i=new f.VertexFormat({position:r.position,normal:r.normal||r.bitangent||e.shadowVolume,tangent:r.tangent,bitangent:r.normal||r.bitangent,st:r.st}),n=e.ellipsoid,u=M(s.CorridorGeometryLibrary.computePositions(e),i,n),y=e.height,p=e.extrudedHeight;let g=u.attributes;const h=u.indices;let C=g.position.values,b=C.length;const A=new Float64Array(6*b);let _=new Float64Array(b);_.set(C);let w,v=new Float64Array(4*b);C=m.PolygonPipeline.scaleToGeodeticHeight(C,y,n),v=O(C,0,v),_=m.PolygonPipeline.scaleToGeodeticHeight(_,p,n),v=O(_,2*b,v),A.set(C),A.set(_,b),A.set(v,2*b),g.position.values=A,g=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;const r=t.position.values;let i,o;(e.normal||e.bitangent)&&(i=t.normal.values,o=t.bitangent.values);const n=t.position.values.length/18,l=3*n,d=2*n,u=2*l;let c;if(e.normal||e.bitangent||e.tangent){const n=e.normal?new Float32Array(6*l):void 0,d=e.tangent?new Float32Array(6*l):void 0,m=e.bitangent?new Float32Array(6*l):void 0;let f=T,y=G,p=E,g=V,h=x,C=F,b=u;for(c=0;c<l;c+=3){const t=b+u;f=a.Cartesian3.fromArray(r,c,f),y=a.Cartesian3.fromArray(r,c+l,y),p=a.Cartesian3.fromArray(r,(c+3)%l,p),y=a.Cartesian3.subtract(y,f,y),p=a.Cartesian3.subtract(p,f,p),g=a.Cartesian3.normalize(a.Cartesian3.cross(y,p,g),g),e.normal&&(s.CorridorGeometryLibrary.addAttribute(n,g,t),s.CorridorGeometryLibrary.addAttribute(n,g,t+3),s.CorridorGeometryLibrary.addAttribute(n,g,b),s.CorridorGeometryLibrary.addAttribute(n,g,b+3)),(e.tangent||e.bitangent)&&(C=a.Cartesian3.fromArray(i,c,C),e.bitangent&&(s.CorridorGeometryLibrary.addAttribute(m,C,t),s.CorridorGeometryLibrary.addAttribute(m,C,t+3),s.CorridorGeometryLibrary.addAttribute(m,C,b),s.CorridorGeometryLibrary.addAttribute(m,C,b+3)),e.tangent&&(h=a.Cartesian3.normalize(a.Cartesian3.cross(C,g,h),h),s.CorridorGeometryLibrary.addAttribute(d,h,t),s.CorridorGeometryLibrary.addAttribute(d,h,t+3),s.CorridorGeometryLibrary.addAttribute(d,h,b),s.CorridorGeometryLibrary.addAttribute(d,h,b+3))),b+=6}if(e.normal){for(n.set(i),c=0;c<l;c+=3)n[c+l]=-i[c],n[c+l+1]=-i[c+1],n[c+l+2]=-i[c+2];t.normal.values=n}else t.normal=void 0;if(e.bitangent?(m.set(o),m.set(o,l),t.bitangent.values=m):t.bitangent=void 0,e.tangent){const e=t.tangent.values;d.set(e),d.set(e,l),t.tangent.values=d}}if(e.st){const e=t.st.values,r=new Float32Array(6*d);r.set(e),r.set(e,d);let a=2*d;for(let t=0;t<2;t++){for(r[a++]=e[0],r[a++]=e[1],c=2;c<d;c+=2){const t=e[c],i=e[c+1];r[a++]=t,r[a++]=i,r[a++]=t,r[a++]=i}r[a++]=e[0],r[a++]=e[1]}t.st.values=r}return t}(g,r);const L=b/3;if(e.shadowVolume){const t=g.normal.values;b=t.length;let e=new Float32Array(6*b);for(w=0;w<b;w++)t[w]=-t[w];e.set(t,b),e=O(t,4*b,e),g.extrudeDirection=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e}),r.normal||(g.normal=void 0)}if(l.defined(e.offsetAttribute)){let r=new Uint8Array(6*L);if(e.offsetAttribute===t.GeometryOffsetAttribute.TOP)r=t.arrayFill(r,1,0,L),r=t.arrayFill(r,1,2*L,4*L);else{const a=e.offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1;r=t.arrayFill(r,a)}g.applyOffset=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}const P=h.length,N=L+L,D=c.IndexDatatype.createTypedArray(A.length/3,2*P+3*N);D.set(h);let I,S,R,k,H=P;for(w=0;w<P;w+=3){const t=h[w],e=h[w+1],r=h[w+2];D[H++]=r+L,D[H++]=e+L,D[H++]=t+L}for(w=0;w<N;w+=2)I=w+N,S=I+N,R=I+1,k=S+1,D[H++]=I,D[H++]=S,D[H++]=R,D[H++]=R,D[H++]=S,D[H++]=k;return{attributes:g,indices:D}}const S=new a.Cartesian3,R=new a.Cartesian3,k=new a.Cartographic;function H(t,e,r,i,o,n){const s=a.Cartesian3.subtract(e,t,S);a.Cartesian3.normalize(s,s);const l=r.geodeticSurfaceNormal(t,R),d=a.Cartesian3.cross(s,l,S);a.Cartesian3.multiplyByScalar(d,i,d);let u=o.latitude,c=o.longitude,m=n.latitude,f=n.longitude;a.Cartesian3.add(t,d,R),r.cartesianToCartographic(R,k);let y=k.latitude,p=k.longitude;u=Math.min(u,y),c=Math.min(c,p),m=Math.max(m,y),f=Math.max(f,p),a.Cartesian3.subtract(t,d,R),r.cartesianToCartographic(R,k),y=k.latitude,p=k.longitude,u=Math.min(u,y),c=Math.min(c,p),m=Math.max(m,y),f=Math.max(f,p),o.latitude=u,o.longitude=c,n.latitude=m,n.longitude=f}const z=new a.Cartesian3,B=new a.Cartesian3,U=new a.Cartographic,Y=new a.Cartographic;function W(t,r,i,o,s){t=N(t,r);const d=e.arrayRemoveDuplicates(t,a.Cartesian3.equalsEpsilon),u=d.length;if(u<2||i<=0)return new a.Rectangle;const c=.5*i;let m,f;if(U.latitude=Number.POSITIVE_INFINITY,U.longitude=Number.POSITIVE_INFINITY,Y.latitude=Number.NEGATIVE_INFINITY,Y.longitude=Number.NEGATIVE_INFINITY,o===n.CornerType.ROUNDED){const t=d[0];a.Cartesian3.subtract(t,d[1],z),a.Cartesian3.normalize(z,z),a.Cartesian3.multiplyByScalar(z,c,z),a.Cartesian3.add(t,z,B),r.cartesianToCartographic(B,k),m=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,m),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,m),Y.longitude=Math.max(Y.longitude,f)}for(let t=0;t<u-1;++t)H(d[t],d[t+1],r,c,U,Y);const y=d[u-1];a.Cartesian3.subtract(y,d[u-2],z),a.Cartesian3.normalize(z,z),a.Cartesian3.multiplyByScalar(z,c,z),a.Cartesian3.add(y,z,B),H(y,B,r,c,U,Y),o===n.CornerType.ROUNDED&&(r.cartesianToCartographic(B,k),m=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,m),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,m),Y.longitude=Math.max(Y.longitude,f));const p=l.defined(s)?s:new a.Rectangle;return p.north=Y.latitude,p.south=U.latitude,p.east=Y.longitude,p.west=U.longitude,p}function q(t){const e=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,r=t.width,i=l.defaultValue(t.height,0),s=l.defaultValue(t.extrudedHeight,i);this._positions=e,this._ellipsoid=a.Ellipsoid.clone(l.defaultValue(t.ellipsoid,a.Ellipsoid.WGS84)),this._vertexFormat=f.VertexFormat.clone(l.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(i,s),this._extrudedHeight=Math.min(i,s),this._cornerType=l.defaultValue(t.cornerType,n.CornerType.ROUNDED),this._granularity=l.defaultValue(t.granularity,o.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=l.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*a.Cartesian3.packedLength+a.Ellipsoid.packedLength+f.VertexFormat.packedLength+7}q.pack=function(t,e,r){r=l.defaultValue(r,0);const i=t._positions,o=i.length;e[r++]=o;for(let t=0;t<o;++t,r+=a.Cartesian3.packedLength)a.Cartesian3.pack(i[t],e,r);return a.Ellipsoid.pack(t._ellipsoid,e,r),r+=a.Ellipsoid.packedLength,f.VertexFormat.pack(t._vertexFormat,e,r),r+=f.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=l.defaultValue(t._offsetAttribute,-1),e};const j=a.Ellipsoid.clone(a.Ellipsoid.UNIT_SPHERE),J=new f.VertexFormat,K={positions:void 0,ellipsoid:j,vertexFormat:J,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return q.unpack=function(t,e,r){e=l.defaultValue(e,0);const i=t[e++],o=new Array(i);for(let r=0;r<i;++r,e+=a.Cartesian3.packedLength)o[r]=a.Cartesian3.unpack(t,e);const n=a.Ellipsoid.unpack(t,e,j);e+=a.Ellipsoid.packedLength;const s=f.VertexFormat.unpack(t,e,J);e+=f.VertexFormat.packedLength;const d=t[e++],u=t[e++],c=t[e++],m=t[e++],y=t[e++],p=1===t[e++],g=t[e];return l.defined(r)?(r._positions=o,r._ellipsoid=a.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(s,r._vertexFormat),r._width=d,r._height=u,r._extrudedHeight=c,r._cornerType=m,r._granularity=y,r._shadowVolume=p,r._offsetAttribute=-1===g?void 0:g,r):(K.positions=o,K.width=d,K.height=u,K.extrudedHeight=c,K.cornerType=m,K.granularity=y,K.shadowVolume=p,K.offsetAttribute=-1===g?void 0:g,new q(K))},q.computeRectangle=function(t,e){const r=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,i=t.width;return W(r,l.defaultValue(t.ellipsoid,a.Ellipsoid.WGS84),i,l.defaultValue(t.cornerType,n.CornerType.ROUNDED),e)},q.createGeometry=function(i){let n=i._positions;const u=i._width,c=i._ellipsoid;n=N(n,c);const f=e.arrayRemoveDuplicates(n,a.Cartesian3.equalsEpsilon);if(f.length<2||u<=0)return;const y=i._height,p=i._extrudedHeight,g=!o.CesiumMath.equalsEpsilon(y,p,0,o.CesiumMath.EPSILON2),h=i._vertexFormat,C={ellipsoid:c,positions:f,width:u,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};let b;if(g)C.height=y,C.extrudedHeight=p,C.shadowVolume=i._shadowVolume,C.offsetAttribute=i._offsetAttribute,b=I(C,h);else{if(b=M(s.CorridorGeometryLibrary.computePositions(C),h,c),b.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(b.attributes.position.values,y,c),l.defined(i._offsetAttribute)){const e=i._offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1,r=b.attributes.position.values.length,a=new Uint8Array(r/3);t.arrayFill(a,e),b.attributes.applyOffset=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}}const A=b.attributes,_=r.BoundingSphere.fromVertices(A.position.values,void 0,3);return h.position||(b.attributes.position.values=void 0),new d.Geometry({attributes:A,indices:b.indices,primitiveType:d.PrimitiveType.TRIANGLES,boundingSphere:_,offsetAttribute:i._offsetAttribute})},q.createShadowVolume=function(t,e,r){const a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new q({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(q.prototype,{rectangle:{get:function(){return l.defined(this._rectangle)||(this._rectangle=W(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return l.defined(e)&&(t=q.unpack(t,e)),t._ellipsoid=a.Ellipsoid.clone(t._ellipsoid),q.createGeometry(t)}})); | ||
define(["./GeometryOffsetAttribute-4d39b441","./arrayRemoveDuplicates-7d5d09a3","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./PolylineVolumeGeometryLibrary-62034f07","./CorridorGeometryLibrary-a3fffc69","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738"],(function(t,e,r,a,i,o,n,s,l,d,u,m,c,f,y,p,g,h,C,b,A,_,w,v){"use strict";const T=new a.Cartesian3,G=new a.Cartesian3,E=new a.Cartesian3,V=new a.Cartesian3,x=new a.Cartesian3,F=new a.Cartesian3,L=new a.Cartesian3,P=new a.Cartesian3;function N(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function D(t,e,r,i,o,n){const l=t.normals,d=t.tangents,u=t.bitangents,m=a.Cartesian3.normalize(a.Cartesian3.cross(r,e,L),L);n.normal&&s.CorridorGeometryLibrary.addAttribute(l,e,i,o),n.tangent&&s.CorridorGeometryLibrary.addAttribute(d,m,i,o),n.bitangent&&s.CorridorGeometryLibrary.addAttribute(u,r,i,o)}function M(t,e,r){const i=t.positions,n=t.corners,c=t.endPositions,f=t.lefts,y=t.normals,p=new u.GeometryAttributes;let g,h,C,b=0,A=0,_=0;for(h=0;h<i.length;h+=2)C=i[h].length-3,b+=C,_+=2*C,A+=i[h+1].length-3;for(b+=3,A+=3,h=0;h<n.length;h++){g=n[h];const t=n[h].leftPositions;l.defined(t)?(C=t.length,b+=C,_+=C):(C=n[h].rightPositions.length,A+=C,_+=C)}const w=l.defined(c);let v;w&&(v=c[0].length-3,b+=v,A+=v,v/=3,_+=6*v);const x=b+A,N=new Float64Array(x),M={normals:e.normal?new Float32Array(x):void 0,tangents:e.tangent?new Float32Array(x):void 0,bitangents:e.bitangent?new Float32Array(x):void 0};let O,I,S,R,k,H,z=0,B=x-1,U=T,Y=G;const W=v/2,q=m.IndexDatatype.createTypedArray(x/3,_);let j=0;if(w){H=E,k=V;const t=c[0];for(U=a.Cartesian3.fromArray(y,0,U),Y=a.Cartesian3.fromArray(f,0,Y),h=0;h<W;h++)H=a.Cartesian3.fromArray(t,3*(W-1-h),H),k=a.Cartesian3.fromArray(t,3*(W+h),k),s.CorridorGeometryLibrary.addAttribute(N,k,z),s.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}let J,K,Q=0,X=0,Z=i[Q++],$=i[Q++];for(N.set(Z,z),N.set($,B-$.length+1),Y=a.Cartesian3.fromArray(f,X,Y),C=$.length-3,h=0;h<C;h+=3)J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,h,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C-h,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;for(J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,C,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),X+=3,h=0;h<n.length;h++){let t;g=n[h];const o=g.leftPositions,d=g.rightPositions;let u,m,c=F,p=E,b=V;if(U=a.Cartesian3.fromArray(y,X,U),l.defined(o)){for(D(M,U,Y,void 0,B,e),B-=3,u=R,m=S,t=0;t<o.length/3;t++)c=a.Cartesian3.fromArray(o,3*t,c),q[j++]=u,q[j++]=m-t-1,q[j++]=m-t,s.CorridorGeometryLibrary.addAttribute(N,c,void 0,B),p=a.Cartesian3.fromArray(N,3*(m-t-1),p),b=a.Cartesian3.fromArray(N,3*u,b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),D(M,U,Y,void 0,B,e),B-=3;c=a.Cartesian3.fromArray(N,3*u,c),p=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*m,p),c,p),b=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*(m-t),b),c,b),Y=a.Cartesian3.normalize(a.Cartesian3.add(p,b,Y),Y),D(M,U,Y,z,void 0,e),z+=3}else{for(D(M,U,Y,z,void 0,e),z+=3,u=S,m=R,t=0;t<d.length/3;t++)c=a.Cartesian3.fromArray(d,3*t,c),q[j++]=u,q[j++]=m+t,q[j++]=m+t+1,s.CorridorGeometryLibrary.addAttribute(N,c,z),p=a.Cartesian3.fromArray(N,3*u,p),b=a.Cartesian3.fromArray(N,3*(m+t),b),Y=a.Cartesian3.normalize(a.Cartesian3.subtract(p,b,Y),Y),D(M,U,Y,z,void 0,e),z+=3;c=a.Cartesian3.fromArray(N,3*u,c),p=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*(m+t),p),c,p),b=a.Cartesian3.subtract(a.Cartesian3.fromArray(N,3*m,b),c,b),Y=a.Cartesian3.normalize(a.Cartesian3.negate(a.Cartesian3.add(b,p,Y),Y),Y),D(M,U,Y,void 0,B,e),B-=3}for(Z=i[Q++],$=i[Q++],Z.splice(0,3),$.splice($.length-3,3),N.set(Z,z),N.set($,B-$.length+1),C=$.length-3,X+=3,Y=a.Cartesian3.fromArray(f,X,Y),t=0;t<$.length;t+=3)J=r.geodeticSurfaceNormal(a.Cartesian3.fromArray(Z,t,L),L),K=r.geodeticSurfaceNormal(a.Cartesian3.fromArray($,C-t,P),P),U=a.Cartesian3.normalize(a.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;z-=3,B+=3}if(U=a.Cartesian3.fromArray(y,y.length-3,U),D(M,U,Y,z,B,e),w){z+=3,B-=3,H=E,k=V;const t=c[1];for(h=0;h<W;h++)H=a.Cartesian3.fromArray(t,3*(v-h-1),H),k=a.Cartesian3.fromArray(t,3*h,k),s.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),s.CorridorGeometryLibrary.addAttribute(N,k,z),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}if(p.position=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:N}),e.st){const t=new Float32Array(x/3*2);let e,r,a=0;if(w){b/=3,A/=3;const i=Math.PI/(v+1);let n;r=1/(b-v+1),e=1/(A-v+1);const s=v/2;for(h=s+1;h<v+1;h++)n=o.CesiumMath.PI_OVER_TWO+i*h,t[a++]=e*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=1;h<A-v+1;h++)t[a++]=h*e,t[a++]=0;for(h=v;h>s;h--)n=o.CesiumMath.PI_OVER_TWO-h*i,t[a++]=1-e*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=s;h>0;h--)n=o.CesiumMath.PI_OVER_TWO-i*h,t[a++]=1-r*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n));for(h=b-v;h>0;h--)t[a++]=h*r,t[a++]=1;for(h=1;h<s+1;h++)n=o.CesiumMath.PI_OVER_TWO+i*h,t[a++]=r*(1+Math.cos(n)),t[a++]=.5*(1+Math.sin(n))}else{for(b/=3,A/=3,r=1/(b-1),e=1/(A-1),h=0;h<A;h++)t[a++]=h*e,t[a++]=0;for(h=b;h>0;h--)t[a++]=(h-1)*r,t[a++]=1}p.st=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}return e.normal&&(p.normal=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.normals})),e.tangent&&(p.tangent=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.tangents})),e.bitangent&&(p.bitangent=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.bitangents})),{attributes:p,indices:q}}function O(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(let a=3;a<t.length;a+=3){const i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function I(e,r){const i=new f.VertexFormat({position:r.position,normal:r.normal||r.bitangent||e.shadowVolume,tangent:r.tangent,bitangent:r.normal||r.bitangent,st:r.st}),n=e.ellipsoid,u=M(s.CorridorGeometryLibrary.computePositions(e),i,n),y=e.height,p=e.extrudedHeight;let g=u.attributes;const h=u.indices;let C=g.position.values,b=C.length;const A=new Float64Array(6*b);let _=new Float64Array(b);_.set(C);let w,v=new Float64Array(4*b);C=c.PolygonPipeline.scaleToGeodeticHeight(C,y,n),v=O(C,0,v),_=c.PolygonPipeline.scaleToGeodeticHeight(_,p,n),v=O(_,2*b,v),A.set(C),A.set(_,b),A.set(v,2*b),g.position.values=A,g=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;const r=t.position.values;let i,o;(e.normal||e.bitangent)&&(i=t.normal.values,o=t.bitangent.values);const n=t.position.values.length/18,l=3*n,d=2*n,u=2*l;let m;if(e.normal||e.bitangent||e.tangent){const n=e.normal?new Float32Array(6*l):void 0,d=e.tangent?new Float32Array(6*l):void 0,c=e.bitangent?new Float32Array(6*l):void 0;let f=T,y=G,p=E,g=V,h=x,C=F,b=u;for(m=0;m<l;m+=3){const t=b+u;f=a.Cartesian3.fromArray(r,m,f),y=a.Cartesian3.fromArray(r,m+l,y),p=a.Cartesian3.fromArray(r,(m+3)%l,p),y=a.Cartesian3.subtract(y,f,y),p=a.Cartesian3.subtract(p,f,p),g=a.Cartesian3.normalize(a.Cartesian3.cross(y,p,g),g),e.normal&&(s.CorridorGeometryLibrary.addAttribute(n,g,t),s.CorridorGeometryLibrary.addAttribute(n,g,t+3),s.CorridorGeometryLibrary.addAttribute(n,g,b),s.CorridorGeometryLibrary.addAttribute(n,g,b+3)),(e.tangent||e.bitangent)&&(C=a.Cartesian3.fromArray(i,m,C),e.bitangent&&(s.CorridorGeometryLibrary.addAttribute(c,C,t),s.CorridorGeometryLibrary.addAttribute(c,C,t+3),s.CorridorGeometryLibrary.addAttribute(c,C,b),s.CorridorGeometryLibrary.addAttribute(c,C,b+3)),e.tangent&&(h=a.Cartesian3.normalize(a.Cartesian3.cross(C,g,h),h),s.CorridorGeometryLibrary.addAttribute(d,h,t),s.CorridorGeometryLibrary.addAttribute(d,h,t+3),s.CorridorGeometryLibrary.addAttribute(d,h,b),s.CorridorGeometryLibrary.addAttribute(d,h,b+3))),b+=6}if(e.normal){for(n.set(i),m=0;m<l;m+=3)n[m+l]=-i[m],n[m+l+1]=-i[m+1],n[m+l+2]=-i[m+2];t.normal.values=n}else t.normal=void 0;if(e.bitangent?(c.set(o),c.set(o,l),t.bitangent.values=c):t.bitangent=void 0,e.tangent){const e=t.tangent.values;d.set(e),d.set(e,l),t.tangent.values=d}}if(e.st){const e=t.st.values,r=new Float32Array(6*d);r.set(e),r.set(e,d);let a=2*d;for(let t=0;t<2;t++){for(r[a++]=e[0],r[a++]=e[1],m=2;m<d;m+=2){const t=e[m],i=e[m+1];r[a++]=t,r[a++]=i,r[a++]=t,r[a++]=i}r[a++]=e[0],r[a++]=e[1]}t.st.values=r}return t}(g,r);const L=b/3;if(e.shadowVolume){const t=g.normal.values;b=t.length;let e=new Float32Array(6*b);for(w=0;w<b;w++)t[w]=-t[w];e.set(t,b),e=O(t,4*b,e),g.extrudeDirection=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e}),r.normal||(g.normal=void 0)}if(l.defined(e.offsetAttribute)){let r=new Uint8Array(6*L);if(e.offsetAttribute===t.GeometryOffsetAttribute.TOP)r=t.arrayFill(r,1,0,L),r=t.arrayFill(r,1,2*L,4*L);else{const a=e.offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1;r=t.arrayFill(r,a)}g.applyOffset=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}const P=h.length,N=L+L,D=m.IndexDatatype.createTypedArray(A.length/3,2*P+3*N);D.set(h);let I,S,R,k,H=P;for(w=0;w<P;w+=3){const t=h[w],e=h[w+1],r=h[w+2];D[H++]=r+L,D[H++]=e+L,D[H++]=t+L}for(w=0;w<N;w+=2)I=w+N,S=I+N,R=I+1,k=S+1,D[H++]=I,D[H++]=S,D[H++]=R,D[H++]=R,D[H++]=S,D[H++]=k;return{attributes:g,indices:D}}const S=new a.Cartesian3,R=new a.Cartesian3,k=new a.Cartographic;function H(t,e,r,i,o,n){const s=a.Cartesian3.subtract(e,t,S);a.Cartesian3.normalize(s,s);const l=r.geodeticSurfaceNormal(t,R),d=a.Cartesian3.cross(s,l,S);a.Cartesian3.multiplyByScalar(d,i,d);let u=o.latitude,m=o.longitude,c=n.latitude,f=n.longitude;a.Cartesian3.add(t,d,R),r.cartesianToCartographic(R,k);let y=k.latitude,p=k.longitude;u=Math.min(u,y),m=Math.min(m,p),c=Math.max(c,y),f=Math.max(f,p),a.Cartesian3.subtract(t,d,R),r.cartesianToCartographic(R,k),y=k.latitude,p=k.longitude,u=Math.min(u,y),m=Math.min(m,p),c=Math.max(c,y),f=Math.max(f,p),o.latitude=u,o.longitude=m,n.latitude=c,n.longitude=f}const z=new a.Cartesian3,B=new a.Cartesian3,U=new a.Cartographic,Y=new a.Cartographic;function W(t,r,i,o,s){t=N(t,r);const d=e.arrayRemoveDuplicates(t,a.Cartesian3.equalsEpsilon),u=d.length;if(u<2||i<=0)return new a.Rectangle;const m=.5*i;let c,f;if(U.latitude=Number.POSITIVE_INFINITY,U.longitude=Number.POSITIVE_INFINITY,Y.latitude=Number.NEGATIVE_INFINITY,Y.longitude=Number.NEGATIVE_INFINITY,o===n.CornerType.ROUNDED){const t=d[0];a.Cartesian3.subtract(t,d[1],z),a.Cartesian3.normalize(z,z),a.Cartesian3.multiplyByScalar(z,m,z),a.Cartesian3.add(t,z,B),r.cartesianToCartographic(B,k),c=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,c),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,c),Y.longitude=Math.max(Y.longitude,f)}for(let t=0;t<u-1;++t)H(d[t],d[t+1],r,m,U,Y);const y=d[u-1];a.Cartesian3.subtract(y,d[u-2],z),a.Cartesian3.normalize(z,z),a.Cartesian3.multiplyByScalar(z,m,z),a.Cartesian3.add(y,z,B),H(y,B,r,m,U,Y),o===n.CornerType.ROUNDED&&(r.cartesianToCartographic(B,k),c=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,c),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,c),Y.longitude=Math.max(Y.longitude,f));const p=l.defined(s)?s:new a.Rectangle;return p.north=Y.latitude,p.south=U.latitude,p.east=Y.longitude,p.west=U.longitude,p}function q(t){const e=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,r=t.width,i=l.defaultValue(t.height,0),s=l.defaultValue(t.extrudedHeight,i);this._positions=e,this._ellipsoid=a.Ellipsoid.clone(l.defaultValue(t.ellipsoid,a.Ellipsoid.WGS84)),this._vertexFormat=f.VertexFormat.clone(l.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(i,s),this._extrudedHeight=Math.min(i,s),this._cornerType=l.defaultValue(t.cornerType,n.CornerType.ROUNDED),this._granularity=l.defaultValue(t.granularity,o.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=l.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*a.Cartesian3.packedLength+a.Ellipsoid.packedLength+f.VertexFormat.packedLength+7}q.pack=function(t,e,r){r=l.defaultValue(r,0);const i=t._positions,o=i.length;e[r++]=o;for(let t=0;t<o;++t,r+=a.Cartesian3.packedLength)a.Cartesian3.pack(i[t],e,r);return a.Ellipsoid.pack(t._ellipsoid,e,r),r+=a.Ellipsoid.packedLength,f.VertexFormat.pack(t._vertexFormat,e,r),r+=f.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=l.defaultValue(t._offsetAttribute,-1),e};const j=a.Ellipsoid.clone(a.Ellipsoid.UNIT_SPHERE),J=new f.VertexFormat,K={positions:void 0,ellipsoid:j,vertexFormat:J,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return q.unpack=function(t,e,r){e=l.defaultValue(e,0);const i=t[e++],o=new Array(i);for(let r=0;r<i;++r,e+=a.Cartesian3.packedLength)o[r]=a.Cartesian3.unpack(t,e);const n=a.Ellipsoid.unpack(t,e,j);e+=a.Ellipsoid.packedLength;const s=f.VertexFormat.unpack(t,e,J);e+=f.VertexFormat.packedLength;const d=t[e++],u=t[e++],m=t[e++],c=t[e++],y=t[e++],p=1===t[e++],g=t[e];return l.defined(r)?(r._positions=o,r._ellipsoid=a.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(s,r._vertexFormat),r._width=d,r._height=u,r._extrudedHeight=m,r._cornerType=c,r._granularity=y,r._shadowVolume=p,r._offsetAttribute=-1===g?void 0:g,r):(K.positions=o,K.width=d,K.height=u,K.extrudedHeight=m,K.cornerType=c,K.granularity=y,K.shadowVolume=p,K.offsetAttribute=-1===g?void 0:g,new q(K))},q.computeRectangle=function(t,e){const r=(t=l.defaultValue(t,l.defaultValue.EMPTY_OBJECT)).positions,i=t.width;return W(r,l.defaultValue(t.ellipsoid,a.Ellipsoid.WGS84),i,l.defaultValue(t.cornerType,n.CornerType.ROUNDED),e)},q.createGeometry=function(i){let n=i._positions;const u=i._width,m=i._ellipsoid;n=N(n,m);const f=e.arrayRemoveDuplicates(n,a.Cartesian3.equalsEpsilon);if(f.length<2||u<=0)return;const y=i._height,p=i._extrudedHeight,g=!o.CesiumMath.equalsEpsilon(y,p,0,o.CesiumMath.EPSILON2),h=i._vertexFormat,C={ellipsoid:m,positions:f,width:u,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};let b;if(g)C.height=y,C.extrudedHeight=p,C.shadowVolume=i._shadowVolume,C.offsetAttribute=i._offsetAttribute,b=I(C,h);else{if(b=M(s.CorridorGeometryLibrary.computePositions(C),h,m),b.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(b.attributes.position.values,y,m),l.defined(i._offsetAttribute)){const e=i._offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1,r=b.attributes.position.values.length,a=new Uint8Array(r/3);t.arrayFill(a,e),b.attributes.applyOffset=new d.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}}const A=b.attributes,_=r.BoundingSphere.fromVertices(A.position.values,void 0,3);return h.position||(b.attributes.position.values=void 0),new d.Geometry({attributes:A,indices:b.indices,primitiveType:d.PrimitiveType.TRIANGLES,boundingSphere:_,offsetAttribute:i._offsetAttribute})},q.createShadowVolume=function(t,e,r){const a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new q({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(q.prototype,{rectangle:{get:function(){return l.defined(this._rectangle)||(this._rectangle=W(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return l.defined(e)&&(t=q.unpack(t,e)),t._ellipsoid=a.Ellipsoid.clone(t._ellipsoid),q.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./GeometryOffsetAttribute-4d39b441","./arrayRemoveDuplicates-fe254feb","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./PolylineVolumeGeometryLibrary-c9777b58","./CorridorGeometryLibrary-0cda5b97","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4"],(function(e,t,i,r,o,n,s,a,l,d,u,p,c,f,h,y,g,b,m,A,_,E,C){"use strict";const G=new r.Cartesian3,T=new r.Cartesian3,P=new r.Cartesian3;function v(e,t){const i=[],o=e.positions,c=e.corners,f=e.endPositions,h=new u.GeometryAttributes;let y,g,b,m=0,A=0,_=0;for(g=0;g<o.length;g+=2)b=o[g].length-3,m+=b,_+=b/3*4,A+=o[g+1].length-3;for(m+=3,A+=3,g=0;g<c.length;g++){y=c[g];const e=c[g].leftPositions;l.defined(e)?(b=e.length,m+=b,_+=b/3*2):(b=c[g].rightPositions.length,A+=b,_+=b/3*2)}const E=l.defined(f);let C;E&&(C=f[0].length-3,m+=C,A+=C,C/=3,_+=4*C);const v=m+A,w=new Float64Array(v);let L,D,x,k,V,H,N=0,O=v-1;const I=C/2,S=p.IndexDatatype.createTypedArray(v/3,_+4);let B=0;if(S[B++]=N/3,S[B++]=(O-2)/3,E){i.push(N/3),H=G,V=T;const e=f[0];for(g=0;g<I;g++)H=r.Cartesian3.fromArray(e,3*(I-1-g),H),V=r.Cartesian3.fromArray(e,3*(I+g),V),a.CorridorGeometryLibrary.addAttribute(w,V,N),a.CorridorGeometryLibrary.addAttribute(w,H,void 0,O),D=N/3,k=D+1,L=(O-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3}let M=0,R=o[M++],U=o[M++];for(w.set(R,N),w.set(U,O-U.length+1),b=U.length-3,i.push(N/3,(O-2)/3),g=0;g<b;g+=3)D=N/3,k=D+1,L=(O-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;for(g=0;g<c.length;g++){let e;y=c[g];const n=y.leftPositions,d=y.rightPositions;let u,p=P;if(l.defined(n)){for(O-=3,u=x,i.push(k),e=0;e<n.length/3;e++)p=r.Cartesian3.fromArray(n,3*e,p),S[B++]=u-e-1,S[B++]=u-e,a.CorridorGeometryLibrary.addAttribute(w,p,void 0,O),O-=3;i.push(u-Math.floor(n.length/6)),t===s.CornerType.BEVELED&&i.push((O-2)/3+1),N+=3}else{for(N+=3,u=k,i.push(x),e=0;e<d.length/3;e++)p=r.Cartesian3.fromArray(d,3*e,p),S[B++]=u+e,S[B++]=u+e+1,a.CorridorGeometryLibrary.addAttribute(w,p,N),N+=3;i.push(u+Math.floor(d.length/6)),t===s.CornerType.BEVELED&&i.push(N/3-1),O-=3}for(R=o[M++],U=o[M++],R.splice(0,3),U.splice(U.length-3,3),w.set(R,N),w.set(U,O-U.length+1),b=U.length-3,e=0;e<U.length;e+=3)k=N/3,D=k-1,x=(O-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;N-=3,O+=3,i.push(N/3,(O-2)/3)}if(E){N+=3,O-=3,H=G,V=T;const e=f[1];for(g=0;g<I;g++)H=r.Cartesian3.fromArray(e,3*(C-g-1),H),V=r.Cartesian3.fromArray(e,3*g,V),a.CorridorGeometryLibrary.addAttribute(w,H,void 0,O),a.CorridorGeometryLibrary.addAttribute(w,V,N),k=N/3,D=k-1,x=(O-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;i.push(N/3)}else i.push(N/3,(O-2)/3);return S[B++]=N/3,S[B++]=(O-2)/3,h.position=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:h,indices:S,wallIndices:i}}function w(e){const t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions,i=e.width,o=l.defaultValue(e.height,0),a=l.defaultValue(e.extrudedHeight,o);this._positions=t,this._ellipsoid=r.Ellipsoid.clone(l.defaultValue(e.ellipsoid,r.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(o,a),this._extrudedHeight=Math.min(o,a),this._cornerType=l.defaultValue(e.cornerType,s.CornerType.ROUNDED),this._granularity=l.defaultValue(e.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+6}w.pack=function(e,t,i){i=l.defaultValue(i,0);const o=e._positions,n=o.length;t[i++]=n;for(let e=0;e<n;++e,i+=r.Cartesian3.packedLength)r.Cartesian3.pack(o[e],t,i);return r.Ellipsoid.pack(e._ellipsoid,t,i),i+=r.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=l.defaultValue(e._offsetAttribute,-1),t};const L=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),D={positions:void 0,ellipsoid:L,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return w.unpack=function(e,t,i){t=l.defaultValue(t,0);const o=e[t++],n=new Array(o);for(let i=0;i<o;++i,t+=r.Cartesian3.packedLength)n[i]=r.Cartesian3.unpack(e,t);const s=r.Ellipsoid.unpack(e,t,L);t+=r.Ellipsoid.packedLength;const a=e[t++],d=e[t++],u=e[t++],p=e[t++],c=e[t++],f=e[t];return l.defined(i)?(i._positions=n,i._ellipsoid=r.Ellipsoid.clone(s,i._ellipsoid),i._width=a,i._height=d,i._extrudedHeight=u,i._cornerType=p,i._granularity=c,i._offsetAttribute=-1===f?void 0:f,i):(D.positions=n,D.width=a,D.height=d,D.extrudedHeight=u,D.cornerType=p,D.granularity=c,D.offsetAttribute=-1===f?void 0:f,new w(D))},w.createGeometry=function(o){let s=o._positions;const u=o._width,f=o._ellipsoid;s=function(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(s,f);const h=t.arrayRemoveDuplicates(s,r.Cartesian3.equalsEpsilon);if(h.length<2||u<=0)return;const y=o._height,g=o._extrudedHeight,b=!n.CesiumMath.equalsEpsilon(y,g,0,n.CesiumMath.EPSILON2),m={ellipsoid:f,positions:h,width:u,cornerType:o._cornerType,granularity:o._granularity,saveAttributes:!1};let A;if(b)m.height=y,m.extrudedHeight=g,m.offsetAttribute=o._offsetAttribute,A=function(t){const i=t.ellipsoid,r=v(a.CorridorGeometryLibrary.computePositions(t),t.cornerType),o=r.wallIndices,s=t.height,u=t.extrudedHeight,f=r.attributes,h=r.indices;let y=f.position.values,g=y.length,b=new Float64Array(g);b.set(y);const m=new Float64Array(2*g);if(y=c.PolygonPipeline.scaleToGeodeticHeight(y,s,i),b=c.PolygonPipeline.scaleToGeodeticHeight(b,u,i),m.set(y),m.set(b,g),f.position.values=m,g/=3,l.defined(t.offsetAttribute)){let i=new Uint8Array(2*g);if(t.offsetAttribute===e.GeometryOffsetAttribute.TOP)i=e.arrayFill(i,1,0,g);else{const r=t.offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;i=e.arrayFill(i,r)}f.applyOffset=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}let A;const _=h.length,E=p.IndexDatatype.createTypedArray(m.length/3,2*(_+o.length));E.set(h);let C,G,T=_;for(A=0;A<_;A+=2){const e=h[A],t=h[A+1];E[T++]=e+g,E[T++]=t+g}for(A=0;A<o.length;A++)C=o[A],G=C+g,E[T++]=C,E[T++]=G;return{attributes:f,indices:E}}(m);else{if(A=v(a.CorridorGeometryLibrary.computePositions(m),m.cornerType),A.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(A.attributes.position.values,y,f),l.defined(o._offsetAttribute)){const t=A.attributes.position.values.length,i=new Uint8Array(t/3),r=o._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(i,r),A.attributes.applyOffset=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const _=A.attributes,E=i.BoundingSphere.fromVertices(_.position.values,void 0,3);return new d.Geometry({attributes:_,indices:A.indices,primitiveType:d.PrimitiveType.LINES,boundingSphere:E,offsetAttribute:o._offsetAttribute})},function(e,t){return l.defined(t)&&(e=w.unpack(e,t)),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),w.createGeometry(e)}})); | ||
define(["./GeometryOffsetAttribute-4d39b441","./arrayRemoveDuplicates-7d5d09a3","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./PolylineVolumeGeometryLibrary-62034f07","./CorridorGeometryLibrary-a3fffc69","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738"],(function(e,t,i,r,o,n,s,a,l,d,u,p,f,c,h,y,g,b,m,A,_,E,C){"use strict";const G=new r.Cartesian3,T=new r.Cartesian3,P=new r.Cartesian3;function v(e,t){const i=[],o=e.positions,f=e.corners,c=e.endPositions,h=new u.GeometryAttributes;let y,g,b,m=0,A=0,_=0;for(g=0;g<o.length;g+=2)b=o[g].length-3,m+=b,_+=b/3*4,A+=o[g+1].length-3;for(m+=3,A+=3,g=0;g<f.length;g++){y=f[g];const e=f[g].leftPositions;l.defined(e)?(b=e.length,m+=b,_+=b/3*2):(b=f[g].rightPositions.length,A+=b,_+=b/3*2)}const E=l.defined(c);let C;E&&(C=c[0].length-3,m+=C,A+=C,C/=3,_+=4*C);const v=m+A,w=new Float64Array(v);let L,D,x,k,V,H,N=0,O=v-1;const I=C/2,S=p.IndexDatatype.createTypedArray(v/3,_+4);let B=0;if(S[B++]=N/3,S[B++]=(O-2)/3,E){i.push(N/3),H=G,V=T;const e=c[0];for(g=0;g<I;g++)H=r.Cartesian3.fromArray(e,3*(I-1-g),H),V=r.Cartesian3.fromArray(e,3*(I+g),V),a.CorridorGeometryLibrary.addAttribute(w,V,N),a.CorridorGeometryLibrary.addAttribute(w,H,void 0,O),D=N/3,k=D+1,L=(O-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3}let M=0,R=o[M++],U=o[M++];for(w.set(R,N),w.set(U,O-U.length+1),b=U.length-3,i.push(N/3,(O-2)/3),g=0;g<b;g+=3)D=N/3,k=D+1,L=(O-2)/3,x=L-1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;for(g=0;g<f.length;g++){let e;y=f[g];const n=y.leftPositions,d=y.rightPositions;let u,p=P;if(l.defined(n)){for(O-=3,u=x,i.push(k),e=0;e<n.length/3;e++)p=r.Cartesian3.fromArray(n,3*e,p),S[B++]=u-e-1,S[B++]=u-e,a.CorridorGeometryLibrary.addAttribute(w,p,void 0,O),O-=3;i.push(u-Math.floor(n.length/6)),t===s.CornerType.BEVELED&&i.push((O-2)/3+1),N+=3}else{for(N+=3,u=k,i.push(x),e=0;e<d.length/3;e++)p=r.Cartesian3.fromArray(d,3*e,p),S[B++]=u+e,S[B++]=u+e+1,a.CorridorGeometryLibrary.addAttribute(w,p,N),N+=3;i.push(u+Math.floor(d.length/6)),t===s.CornerType.BEVELED&&i.push(N/3-1),O-=3}for(R=o[M++],U=o[M++],R.splice(0,3),U.splice(U.length-3,3),w.set(R,N),w.set(U,O-U.length+1),b=U.length-3,e=0;e<U.length;e+=3)k=N/3,D=k-1,x=(O-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;N-=3,O+=3,i.push(N/3,(O-2)/3)}if(E){N+=3,O-=3,H=G,V=T;const e=c[1];for(g=0;g<I;g++)H=r.Cartesian3.fromArray(e,3*(C-g-1),H),V=r.Cartesian3.fromArray(e,3*g,V),a.CorridorGeometryLibrary.addAttribute(w,H,void 0,O),a.CorridorGeometryLibrary.addAttribute(w,V,N),k=N/3,D=k-1,x=(O-2)/3,L=x+1,S[B++]=L,S[B++]=x,S[B++]=D,S[B++]=k,N+=3,O-=3;i.push(N/3)}else i.push(N/3,(O-2)/3);return S[B++]=N/3,S[B++]=(O-2)/3,h.position=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:h,indices:S,wallIndices:i}}function w(e){const t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions,i=e.width,o=l.defaultValue(e.height,0),a=l.defaultValue(e.extrudedHeight,o);this._positions=t,this._ellipsoid=r.Ellipsoid.clone(l.defaultValue(e.ellipsoid,r.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(o,a),this._extrudedHeight=Math.min(o,a),this._cornerType=l.defaultValue(e.cornerType,s.CornerType.ROUNDED),this._granularity=l.defaultValue(e.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+6}w.pack=function(e,t,i){i=l.defaultValue(i,0);const o=e._positions,n=o.length;t[i++]=n;for(let e=0;e<n;++e,i+=r.Cartesian3.packedLength)r.Cartesian3.pack(o[e],t,i);return r.Ellipsoid.pack(e._ellipsoid,t,i),i+=r.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=l.defaultValue(e._offsetAttribute,-1),t};const L=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),D={positions:void 0,ellipsoid:L,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return w.unpack=function(e,t,i){t=l.defaultValue(t,0);const o=e[t++],n=new Array(o);for(let i=0;i<o;++i,t+=r.Cartesian3.packedLength)n[i]=r.Cartesian3.unpack(e,t);const s=r.Ellipsoid.unpack(e,t,L);t+=r.Ellipsoid.packedLength;const a=e[t++],d=e[t++],u=e[t++],p=e[t++],f=e[t++],c=e[t];return l.defined(i)?(i._positions=n,i._ellipsoid=r.Ellipsoid.clone(s,i._ellipsoid),i._width=a,i._height=d,i._extrudedHeight=u,i._cornerType=p,i._granularity=f,i._offsetAttribute=-1===c?void 0:c,i):(D.positions=n,D.width=a,D.height=d,D.extrudedHeight=u,D.cornerType=p,D.granularity=f,D.offsetAttribute=-1===c?void 0:c,new w(D))},w.createGeometry=function(o){let s=o._positions;const u=o._width,c=o._ellipsoid;s=function(e,t){for(let i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(s,c);const h=t.arrayRemoveDuplicates(s,r.Cartesian3.equalsEpsilon);if(h.length<2||u<=0)return;const y=o._height,g=o._extrudedHeight,b=!n.CesiumMath.equalsEpsilon(y,g,0,n.CesiumMath.EPSILON2),m={ellipsoid:c,positions:h,width:u,cornerType:o._cornerType,granularity:o._granularity,saveAttributes:!1};let A;if(b)m.height=y,m.extrudedHeight=g,m.offsetAttribute=o._offsetAttribute,A=function(t){const i=t.ellipsoid,r=v(a.CorridorGeometryLibrary.computePositions(t),t.cornerType),o=r.wallIndices,s=t.height,u=t.extrudedHeight,c=r.attributes,h=r.indices;let y=c.position.values,g=y.length,b=new Float64Array(g);b.set(y);const m=new Float64Array(2*g);if(y=f.PolygonPipeline.scaleToGeodeticHeight(y,s,i),b=f.PolygonPipeline.scaleToGeodeticHeight(b,u,i),m.set(y),m.set(b,g),c.position.values=m,g/=3,l.defined(t.offsetAttribute)){let i=new Uint8Array(2*g);if(t.offsetAttribute===e.GeometryOffsetAttribute.TOP)i=e.arrayFill(i,1,0,g);else{const r=t.offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;i=e.arrayFill(i,r)}c.applyOffset=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}let A;const _=h.length,E=p.IndexDatatype.createTypedArray(m.length/3,2*(_+o.length));E.set(h);let C,G,T=_;for(A=0;A<_;A+=2){const e=h[A],t=h[A+1];E[T++]=e+g,E[T++]=t+g}for(A=0;A<o.length;A++)C=o[A],G=C+g,E[T++]=C,E[T++]=G;return{attributes:c,indices:E}}(m);else{if(A=v(a.CorridorGeometryLibrary.computePositions(m),m.cornerType),A.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(A.attributes.position.values,y,c),l.defined(o._offsetAttribute)){const t=A.attributes.position.values.length,i=new Uint8Array(t/3),r=o._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(i,r),A.attributes.applyOffset=new d.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const _=A.attributes,E=i.BoundingSphere.fromVertices(_.position.values,void 0,3);return new d.Geometry({attributes:_,indices:A.indices,primitiveType:d.PrimitiveType.LINES,boundingSphere:E,offsetAttribute:o._offsetAttribute})},function(e,t){return l.defined(t)&&(e=w.unpack(e,t)),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),w.createGeometry(e)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./CylinderGeometry-723ca1ba","./defaultValue-69ee94f4","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-06c05e21","./Matrix2-e6265fb0","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./CylinderGeometryLibrary-fe5ec654","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./VertexFormat-e68722dd"],(function(e,t,r,a,n,o,c,i,f,m,y,d,b,u,s){"use strict";return function(r,a){return t.defined(a)&&(r=e.CylinderGeometry.unpack(r,a)),e.CylinderGeometry.createGeometry(r)}})); | ||
define(["./CylinderGeometry-9b5e6460","./defaultValue-69ee94f4","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./CylinderGeometryLibrary-3c958a1d","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./VertexFormat-e68722dd"],(function(e,t,r,a,n,d,o,f,i,m,y,b,c,u,s){"use strict";return function(r,a){return t.defined(a)&&(r=e.CylinderGeometry.unpack(r,a)),e.CylinderGeometry.createGeometry(r)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./CylinderGeometryLibrary-fe5ec654","./defaultValue-69ee94f4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(t,e,i,n,o,r,a,s,u,f,c,d,l){"use strict";const m=new i.Cartesian2;function b(t){const e=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,n=t.bottomRadius,o=a.defaultValue(t.slices,128),r=Math.max(a.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=n,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}b.packedLength=6,b.pack=function(t,e,i){return i=a.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=a.defaultValue(t._offsetAttribute,-1),e};const p={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return b.unpack=function(t,e,i){e=a.defaultValue(e,0);const n=t[e++],o=t[e++],r=t[e++],s=t[e++],u=t[e++],f=t[e];return a.defined(i)?(i._length=n,i._topRadius=o,i._bottomRadius=r,i._slices=s,i._numberOfVerticalLines=u,i._offsetAttribute=-1===f?void 0:f,i):(p.length=n,p.topRadius=o,p.bottomRadius=r,p.slices=s,p.numberOfVerticalLines=u,p.offsetAttribute=-1===f?void 0:f,new b(p))},b.createGeometry=function(n){let c=n._length;const d=n._topRadius,l=n._bottomRadius,b=n._slices,p=n._numberOfVerticalLines;if(c<=0||d<0||l<0||0===d&&0===l)return;const y=2*b,_=r.CylinderGeometryLibrary.computePositions(c,d,l,b,!1);let h,A=2*b;if(p>0){const t=Math.min(p,b);h=Math.round(b/t),A+=t}const R=f.IndexDatatype.createTypedArray(y,2*A);let G,O=0;for(G=0;G<b-1;G++)R[O++]=G,R[O++]=G+1,R[O++]=G+b,R[O++]=G+1+b;if(R[O++]=b-1,R[O++]=0,R[O++]=b+b-1,R[O++]=b,p>0)for(G=0;G<b;G+=h)R[O++]=G,R[O++]=G+b;const V=new u.GeometryAttributes;V.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:_}),m.x=.5*c,m.y=Math.max(l,d);const L=new e.BoundingSphere(i.Cartesian3.ZERO,i.Cartesian2.magnitude(m));if(a.defined(n._offsetAttribute)){c=_.length;const e=new Uint8Array(c/3),i=n._offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1;t.arrayFill(e,i),V.applyOffset=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return new s.Geometry({attributes:V,indices:R,primitiveType:s.PrimitiveType.LINES,boundingSphere:L,offsetAttribute:n._offsetAttribute})},function(t,e){return a.defined(e)&&(t=b.unpack(t,e)),b.createGeometry(t)}})); | ||
define(["./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./CylinderGeometryLibrary-3c958a1d","./defaultValue-69ee94f4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(t,e,i,n,o,r,a,s,u,f,d,c,l){"use strict";const m=new i.Cartesian2;function b(t){const e=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,n=t.bottomRadius,o=a.defaultValue(t.slices,128),r=Math.max(a.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=n,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}b.packedLength=6,b.pack=function(t,e,i){return i=a.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=a.defaultValue(t._offsetAttribute,-1),e};const p={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return b.unpack=function(t,e,i){e=a.defaultValue(e,0);const n=t[e++],o=t[e++],r=t[e++],s=t[e++],u=t[e++],f=t[e];return a.defined(i)?(i._length=n,i._topRadius=o,i._bottomRadius=r,i._slices=s,i._numberOfVerticalLines=u,i._offsetAttribute=-1===f?void 0:f,i):(p.length=n,p.topRadius=o,p.bottomRadius=r,p.slices=s,p.numberOfVerticalLines=u,p.offsetAttribute=-1===f?void 0:f,new b(p))},b.createGeometry=function(n){let d=n._length;const c=n._topRadius,l=n._bottomRadius,b=n._slices,p=n._numberOfVerticalLines;if(d<=0||c<0||l<0||0===c&&0===l)return;const y=2*b,_=r.CylinderGeometryLibrary.computePositions(d,c,l,b,!1);let h,A=2*b;if(p>0){const t=Math.min(p,b);h=Math.round(b/t),A+=t}const R=f.IndexDatatype.createTypedArray(y,2*A);let G,O=0;for(G=0;G<b-1;G++)R[O++]=G,R[O++]=G+1,R[O++]=G+b,R[O++]=G+1+b;if(R[O++]=b-1,R[O++]=0,R[O++]=b+b-1,R[O++]=b,p>0)for(G=0;G<b;G+=h)R[O++]=G,R[O++]=G+b;const V=new u.GeometryAttributes;V.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:_}),m.x=.5*d,m.y=Math.max(l,c);const L=new e.BoundingSphere(i.Cartesian3.ZERO,i.Cartesian2.magnitude(m));if(a.defined(n._offsetAttribute)){d=_.length;const e=new Uint8Array(d/3),i=n._offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1;t.arrayFill(e,i),V.applyOffset=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return new s.Geometry({attributes:V,indices:R,primitiveType:s.PrimitiveType.LINES,boundingSphere:L,offsetAttribute:n._offsetAttribute})},function(t,e){return a.defined(e)&&(t=b.unpack(t,e)),b.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./Matrix2-e6265fb0","./defaultValue-69ee94f4","./EllipseGeometry-43f9e5b7","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-2b119a38","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./IndexDatatype-1cbc8622","./IntersectionTests-94cb8698","./Plane-042297c7","./VertexFormat-e68722dd"],(function(e,t,r,n,o,a,i,s,c,l,f,m,b,d,p,u,y,G,E,C,_){"use strict";return function(n,o){return t.defined(o)&&(n=r.EllipseGeometry.unpack(n,o)),n._center=e.Cartesian3.clone(n._center),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),r.EllipseGeometry.createGeometry(n)}})); | ||
define(["./Matrix2-1ba2543c","./defaultValue-69ee94f4","./EllipseGeometry-7f98d885","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-70ca3053","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./IndexDatatype-0b020dfb","./IntersectionTests-4547e13f","./Plane-faef0199","./VertexFormat-e68722dd"],(function(e,t,r,a,n,o,i,s,c,d,f,l,m,b,p,u,y,G,E,C,_){"use strict";return function(a,n){return t.defined(n)&&(a=r.EllipseGeometry.unpack(a,n)),a._center=e.Cartesian3.clone(a._center),a._ellipsoid=e.Ellipsoid.clone(a._ellipsoid),r.EllipseGeometry.createGeometry(a)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./Matrix2-e6265fb0","./defaultValue-69ee94f4","./EllipseOutlineGeometry-5a39395e","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-2b119a38","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622"],(function(e,t,r,i,n,a,o,l,c,s,u,f,m,b){"use strict";return function(i,n){return t.defined(n)&&(i=r.EllipseOutlineGeometry.unpack(i,n)),i._center=e.Cartesian3.clone(i._center),i._ellipsoid=e.Ellipsoid.clone(i._ellipsoid),r.EllipseOutlineGeometry.createGeometry(i)}})); | ||
define(["./Matrix2-1ba2543c","./defaultValue-69ee94f4","./EllipseOutlineGeometry-a5a2b688","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./EllipseGeometryLibrary-70ca3053","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb"],(function(e,t,r,a,i,n,o,l,s,c,f,d,u,b){"use strict";return function(a,i){return t.defined(i)&&(a=r.EllipseOutlineGeometry.unpack(a,i)),a._center=e.Cartesian3.clone(a._center),a._ellipsoid=e.Ellipsoid.clone(a._ellipsoid),r.EllipseOutlineGeometry.createGeometry(a)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./EllipsoidGeometry-418f414a","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-06c05e21","./Matrix2-e6265fb0","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./VertexFormat-e68722dd"],(function(e,t,r,o,a,n,i,f,c,m,s,d,u,b){"use strict";return function(r,o){return e.defined(o)&&(r=t.EllipsoidGeometry.unpack(r,o)),t.EllipsoidGeometry.createGeometry(r)}})); | ||
define(["./defaultValue-69ee94f4","./EllipsoidGeometry-591d0b9b","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./VertexFormat-e68722dd"],(function(e,t,r,a,o,d,n,i,f,b,m,s,u,c){"use strict";return function(r,a){return e.defined(a)&&(r=t.EllipsoidGeometry.unpack(r,a)),t.EllipsoidGeometry.createGeometry(r)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./EllipsoidOutlineGeometry-1081cab8","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-06c05e21","./Matrix2-e6265fb0","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622"],(function(e,t,r,n,i,o,a,f,u,c,m,s,b){"use strict";return function(r,n){return e.defined(r.buffer)&&(r=t.EllipsoidOutlineGeometry.unpack(r,n)),t.EllipsoidOutlineGeometry.createGeometry(r)}})); | ||
define(["./defaultValue-69ee94f4","./EllipsoidOutlineGeometry-08ca8d96","./GeometryOffsetAttribute-4d39b441","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb"],(function(e,t,r,a,n,i,o,f,d,u,b,m,s){"use strict";return function(r,a){return e.defined(r.buffer)&&(r=t.EllipsoidOutlineGeometry.unpack(r,a)),t.EllipsoidOutlineGeometry.createGeometry(r)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./FrustumGeometry-a1fefbf4","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./Plane-042297c7","./VertexFormat-e68722dd"],(function(e,t,r,a,n,o,u,m,f,c,s,i,b){"use strict";return function(r,a){return e.defined(a)&&(r=t.FrustumGeometry.unpack(r,a)),t.FrustumGeometry.createGeometry(r)}})); | ||
define(["./defaultValue-69ee94f4","./FrustumGeometry-9856383f","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./Plane-faef0199","./VertexFormat-e68722dd"],(function(e,t,r,a,n,o,u,f,m,s,c,d,i){"use strict";return function(r,a){return e.defined(a)&&(r=t.FrustumGeometry.unpack(r,a)),t.FrustumGeometry.createGeometry(r)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./FrustumGeometry-a1fefbf4","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./Plane-042297c7","./VertexFormat-e68722dd"],(function(e,t,r,n,a,u,i,o,s,c,p,m,f){"use strict";function h(n){const a=n.frustum,i=n.orientation,o=n.origin,s=e.defaultValue(n._drawNearPlane,!0);let c,p;a instanceof u.PerspectiveFrustum?(c=0,p=u.PerspectiveFrustum.packedLength):a instanceof u.OrthographicFrustum&&(c=1,p=u.OrthographicFrustum.packedLength),this._frustumType=c,this._frustum=a.clone(),this._origin=r.Cartesian3.clone(o),this._orientation=t.Quaternion.clone(i),this._drawNearPlane=s,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+r.Cartesian3.packedLength+t.Quaternion.packedLength}h.pack=function(n,a,i){i=e.defaultValue(i,0);const o=n._frustumType,s=n._frustum;return a[i++]=o,0===o?(u.PerspectiveFrustum.pack(s,a,i),i+=u.PerspectiveFrustum.packedLength):(u.OrthographicFrustum.pack(s,a,i),i+=u.OrthographicFrustum.packedLength),r.Cartesian3.pack(n._origin,a,i),i+=r.Cartesian3.packedLength,t.Quaternion.pack(n._orientation,a,i),a[i+=t.Quaternion.packedLength]=n._drawNearPlane?1:0,a};const d=new u.PerspectiveFrustum,l=new u.OrthographicFrustum,g=new t.Quaternion,_=new r.Cartesian3;return h.unpack=function(n,a,i){a=e.defaultValue(a,0);const o=n[a++];let s;0===o?(s=u.PerspectiveFrustum.unpack(n,a,d),a+=u.PerspectiveFrustum.packedLength):(s=u.OrthographicFrustum.unpack(n,a,l),a+=u.OrthographicFrustum.packedLength);const c=r.Cartesian3.unpack(n,a,_);a+=r.Cartesian3.packedLength;const p=t.Quaternion.unpack(n,a,g),m=1===n[a+=t.Quaternion.packedLength];if(!e.defined(i))return new h({frustum:s,origin:c,orientation:p,_drawNearPlane:m});const f=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(f),i._frustumType=o,i._origin=r.Cartesian3.clone(c,i._origin),i._orientation=t.Quaternion.clone(p,i._orientation),i._drawNearPlane=m,i},h.createGeometry=function(e){const r=e._frustumType,n=e._frustum,s=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);u.FrustumGeometry._computeNearFarPlanes(s,c,r,n,m);const f=new o.GeometryAttributes({position:new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let h,d;const l=p?2:1,g=new Uint16Array(8*(l+1));let _=p?0:1;for(;_<2;++_)h=p?8*_:0,d=4*_,g[h]=d,g[h+1]=d+1,g[h+2]=d+1,g[h+3]=d+2,g[h+4]=d+2,g[h+5]=d+3,g[h+6]=d+3,g[h+7]=d;for(_=0;_<2;++_)h=8*(l+_),d=4*_,g[h]=d,g[h+1]=d+4,g[h+2]=d+1,g[h+3]=d+5,g[h+4]=d+2,g[h+5]=d+6,g[h+6]=d+3,g[h+7]=d+7;return new i.Geometry({attributes:f,indices:g,primitiveType:i.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=h.unpack(t,r)),h.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./FrustumGeometry-9856383f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./Plane-faef0199","./VertexFormat-e68722dd"],(function(e,t,r,n,a,u,i,o,s,c,p,m,f){"use strict";function d(n){const a=n.frustum,i=n.orientation,o=n.origin,s=e.defaultValue(n._drawNearPlane,!0);let c,p;a instanceof u.PerspectiveFrustum?(c=0,p=u.PerspectiveFrustum.packedLength):a instanceof u.OrthographicFrustum&&(c=1,p=u.OrthographicFrustum.packedLength),this._frustumType=c,this._frustum=a.clone(),this._origin=r.Cartesian3.clone(o),this._orientation=t.Quaternion.clone(i),this._drawNearPlane=s,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+r.Cartesian3.packedLength+t.Quaternion.packedLength}d.pack=function(n,a,i){i=e.defaultValue(i,0);const o=n._frustumType,s=n._frustum;return a[i++]=o,0===o?(u.PerspectiveFrustum.pack(s,a,i),i+=u.PerspectiveFrustum.packedLength):(u.OrthographicFrustum.pack(s,a,i),i+=u.OrthographicFrustum.packedLength),r.Cartesian3.pack(n._origin,a,i),i+=r.Cartesian3.packedLength,t.Quaternion.pack(n._orientation,a,i),a[i+=t.Quaternion.packedLength]=n._drawNearPlane?1:0,a};const h=new u.PerspectiveFrustum,l=new u.OrthographicFrustum,g=new t.Quaternion,_=new r.Cartesian3;return d.unpack=function(n,a,i){a=e.defaultValue(a,0);const o=n[a++];let s;0===o?(s=u.PerspectiveFrustum.unpack(n,a,h),a+=u.PerspectiveFrustum.packedLength):(s=u.OrthographicFrustum.unpack(n,a,l),a+=u.OrthographicFrustum.packedLength);const c=r.Cartesian3.unpack(n,a,_);a+=r.Cartesian3.packedLength;const p=t.Quaternion.unpack(n,a,g),m=1===n[a+=t.Quaternion.packedLength];if(!e.defined(i))return new d({frustum:s,origin:c,orientation:p,_drawNearPlane:m});const f=o===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(f),i._frustumType=o,i._origin=r.Cartesian3.clone(c,i._origin),i._orientation=t.Quaternion.clone(p,i._orientation),i._drawNearPlane=m,i},d.createGeometry=function(e){const r=e._frustumType,n=e._frustum,s=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);u.FrustumGeometry._computeNearFarPlanes(s,c,r,n,m);const f=new o.GeometryAttributes({position:new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let d,h;const l=p?2:1,g=new Uint16Array(8*(l+1));let _=p?0:1;for(;_<2;++_)d=p?8*_:0,h=4*_,g[d]=h,g[d+1]=h+1,g[d+2]=h+1,g[d+3]=h+2,g[d+4]=h+2,g[d+5]=h+3,g[d+6]=h+3,g[d+7]=h;for(_=0;_<2;++_)d=8*(l+_),h=4*_,g[d]=h,g[d+1]=h+4,g[d+2]=h+1,g[d+3]=h+5,g[d+4]=h+2,g[d+5]=h+6,g[d+6]=h+3,g[d+7]=h+7;return new i.Geometry({attributes:f,indices:g,primitiveType:i.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=d.unpack(t,r)),d.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./PrimitivePipeline-9bc85f23","./createTaskProcessorWorker","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryPipeline-311a1f9e","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./IndexDatatype-1cbc8622","./IntersectionTests-94cb8698","./Plane-042297c7","./WebMercatorProjection-50f5da31"],(function(e,t,r,n,o,i,s,a,c,f,u,m,b,l,d,p,y,P,k){"use strict";const C={};function G(t){let r=C[t];return e.defined(r)||("object"==typeof exports?C[r]=r=require(`Workers/${t}`):require([`Workers/${t}`],(function(e){r=e,C[r]=e}))),r}return r((function(r,n){const o=r.subTasks,i=o.length,s=new Array(i);for(let t=0;t<i;t++){const r=o[t],n=r.geometry,i=r.moduleName;if(e.defined(i)){const e=G(i);s[t]=e(n,r.offset)}else s[t]=n}return Promise.all(s).then((function(e){return t.PrimitivePipeline.packCreateGeometryResults(e,n)}))}))})); | ||
define(["./defaultValue-69ee94f4","./PrimitivePipeline-8cf7c60b","./createTaskProcessorWorker","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryPipeline-20b6a6da","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./IndexDatatype-0b020dfb","./IntersectionTests-4547e13f","./Plane-faef0199","./WebMercatorProjection-7e95daf8"],(function(e,t,r,n,o,a,i,s,c,f,u,d,m,b,l,p,y,P,k){"use strict";const C={};function G(t){let r=C[t];return e.defined(r)||("object"==typeof exports?C[r]=r=require(`Workers/${t}`):require([`Workers/${t}`],(function(e){r=e,C[r]=e}))),r}return r((function(r,n){const o=r.subTasks,a=o.length,i=new Array(a);for(let t=0;t<a;t++){const r=o[t],n=r.geometry,a=r.moduleName;if(e.defined(a)){const e=G(a);i[t]=e(n,r.offset)}else i[t]=n}return Promise.all(i).then((function(e){return t.PrimitivePipeline.packCreateGeometryResults(e,n)}))}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./ComponentDatatype-a9820060","./ArcType-e1641d8d","./arrayRemoveDuplicates-fe254feb","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./EncodedCartesian3-20914bf5","./GeometryAttribute-b7edcc35","./IntersectionTests-94cb8698","./Plane-042297c7","./WebMercatorProjection-50f5da31","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,a,n,i,r,s,o,l,c,u,C,p,d,h,g,f){"use strict";function m(a){a=n.defaultValue(a,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84),this._rectangle=n.defaultValue(a.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(a.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(a.numberOfLevelZeroTilesY,1)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),m.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},m.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},m.prototype.rectangleToNativeRectangle=function(e,a){const r=i.CesiumMath.toDegrees(e.west),s=i.CesiumMath.toDegrees(e.south),o=i.CesiumMath.toDegrees(e.east),l=i.CesiumMath.toDegrees(e.north);return n.defined(a)?(a.west=r,a.south=s,a.east=o,a.north=l,a):new t.Rectangle(r,s,o,l)},m.prototype.tileXYToNativeRectangle=function(e,t,a,n){const r=this.tileXYToRectangle(e,t,a,n);return r.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},m.prototype.tileXYToRectangle=function(e,a,i,r){const s=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,p=s.height/l,d=s.north-a*p,h=s.north-(a+1)*p;return n.defined(r)||(r=new t.Rectangle(u,h,C,d)),r.west=u,r.south=h,r.east=C,r.north=d,r},m.prototype.positionToTileXY=function(e,a,r){const s=this._rectangle;if(!t.Rectangle.contains(s,e))return;const o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;let C=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);let p=(C-s.west)/c|0;p>=o&&(p=o-1);let d=(s.north-e.latitude)/u|0;return d>=l&&(d=l-1),n.defined(r)?(r.x=p,r.y=d,r):new t.Cartesian2(p,d)};const w=new t.Cartesian3,y=new t.Cartesian3,M=new t.Cartographic,T=new t.Cartesian3,E=new t.Cartesian3,_=new e.BoundingSphere,O=new m,b=[new t.Cartographic,new t.Cartographic,new t.Cartographic,new t.Cartographic],P=new t.Cartesian2,A={};function k(e){t.Cartographic.fromRadians(e.east,e.north,0,b[0]),t.Cartographic.fromRadians(e.west,e.north,0,b[1]),t.Cartographic.fromRadians(e.east,e.south,0,b[2]),t.Cartographic.fromRadians(e.west,e.south,0,b[3]);let a=0,n=0,i=0,r=0;const s=A._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let t=0;t<4;++t){const a=b[t];if(O.positionToTileXY(a,o,P),0===t)i=P.x,r=P.y;else if(i!==P.x||r!==P.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}}A.initialize=function(){let t=A._initPromise;return n.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){A._terrainHeights=e})),A._initPromise=t),t},A.getMinimumMaximumHeights=function(e,a){a=n.defaultValue(a,t.Ellipsoid.WGS84);const i=k(e);let r=A._defaultMinTerrainHeight,s=A._defaultMaxTerrainHeight;if(n.defined(i)){const o=`${i.level}-${i.x}-${i.y}`,l=A._terrainHeights[o];n.defined(l)&&(r=l[0],s=l[1]),a.cartographicToCartesian(t.Rectangle.northeast(e,M),w),a.cartographicToCartesian(t.Rectangle.southwest(e,M),y),t.Cartesian3.midpoint(y,w,T);const c=a.scaleToGeodeticSurface(T,E);if(n.defined(c)){const e=t.Cartesian3.distance(T,c);r=Math.min(r,-e)}else r=A._defaultMinTerrainHeight}return r=Math.max(A._defaultMinTerrainHeight,r),{minimumTerrainHeight:r,maximumTerrainHeight:s}},A.getBoundingSphere=function(a,i){i=n.defaultValue(i,t.Ellipsoid.WGS84);const r=k(a);let s=A._defaultMaxTerrainHeight;if(n.defined(r)){const e=`${r.level}-${r.x}-${r.y}`,t=A._terrainHeights[e];n.defined(t)&&(s=t[1])}const o=e.BoundingSphere.fromRectangle3D(a,i,0);return e.BoundingSphere.fromRectangle3D(a,i,s,_),e.BoundingSphere.union(o,_,o)},A._terrainHeightsMaxLevel=6,A._defaultMaxTerrainHeight=9e3,A._defaultMinTerrainHeight=-1e5,A._terrainHeights=void 0,A._initPromise=void 0,Object.defineProperties(A,{initialized:{get:function(){return n.defined(A._terrainHeights)}}});const L=[e.GeographicProjection,d.WebMercatorProjection],S=L.length,x=Math.cos(i.CesiumMath.toRadians(30)),I=Math.cos(i.CesiumMath.toRadians(150));function N(e){const a=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).positions;this.width=n.defaultValue(e.width,1),this._positions=a,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=t.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(N.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+t.Ellipsoid.packedLength+1+1}}}),N.setProjectionAndEllipsoid=function(e,t){let a=0;for(let e=0;e<S;e++)if(t instanceof L[e]){a=e;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};const R=new t.Cartesian3,D=new t.Cartesian3,v=new t.Cartesian3;function z(e,a,n,i,r){const s=F(i,e,0,R),o=F(i,e,n,D),l=F(i,a,0,v),c=q(o,s,D),u=q(l,s,v);return t.Cartesian3.cross(u,c,r),t.Cartesian3.normalize(r,r)}const H=new t.Cartographic,j=new t.Cartesian3,B=new t.Cartesian3,V=new t.Cartesian3;function G(e,a,n,i,s,c,u,C,p,d,h){if(0===s)return;let g;c===r.ArcType.GEODESIC?g=new o.EllipsoidGeodesic(e,a,u):c===r.ArcType.RHUMB&&(g=new l.EllipsoidRhumbLine(e,a,u));const f=g.surfaceDistance;if(f<s)return;const m=z(e,a,i,u,V),w=Math.ceil(f/s),y=f/w;let M=y;const T=w-1;let E=C.length;for(let e=0;e<T;e++){const e=g.interpolateUsingSurfaceDistance(M,H),a=F(u,e,n,j),r=F(u,e,i,B);t.Cartesian3.pack(m,C,E),t.Cartesian3.pack(a,p,E),t.Cartesian3.pack(r,d,E),h.push(e.latitude),h.push(e.longitude),E+=3,M+=y}}const Y=new t.Cartographic;function F(e,a,n,i){return t.Cartographic.clone(a,Y),Y.height=n,t.Cartographic.toCartesian(Y,e,i)}function q(e,a,n){return t.Cartesian3.subtract(e,a,n),t.Cartesian3.normalize(n,n),n}function X(e,a,n,i){return i=q(e,a,i),i=t.Cartesian3.cross(i,n,i),i=t.Cartesian3.normalize(i,i),i=t.Cartesian3.cross(n,i,i)}N.pack=function(e,a,i){let r=n.defaultValue(i,0);const s=e._positions,o=s.length;a[r++]=o;for(let e=0;e<o;++e){const n=s[e];t.Cartesian3.pack(n,a,r),r+=3}return a[r++]=e.granularity,a[r++]=e.loop?1:0,a[r++]=e.arcType,t.Ellipsoid.pack(e._ellipsoid,a,r),r+=t.Ellipsoid.packedLength,a[r++]=e._projectionIndex,a[r++]=e._scene3DOnly?1:0,a},N.unpack=function(e,a,i){let r=n.defaultValue(a,0);const s=e[r++],o=new Array(s);for(let a=0;a<s;a++)o[a]=t.Cartesian3.unpack(e,r),r+=3;const l=e[r++],c=1===e[r++],u=e[r++],C=t.Ellipsoid.unpack(e,r);r+=t.Ellipsoid.packedLength;const p=e[r++],d=1===e[r++];return n.defined(i)||(i=new N({positions:o})),i._positions=o,i.granularity=l,i.loop=c,i.arcType=u,i._ellipsoid=C,i._projectionIndex=p,i._scene3DOnly=d,i};const W=new t.Cartesian3,U=new t.Cartesian3,Z=new t.Cartesian3,$=new t.Cartesian3;function J(e,a,n,r,s){const o=q(n,a,$),l=X(e,a,o,W),c=X(r,a,o,U);if(i.CesiumMath.equalsEpsilon(t.Cartesian3.dot(l,c),-1,i.CesiumMath.EPSILON5))return s=t.Cartesian3.cross(o,l,s),s=t.Cartesian3.normalize(s,s);s=t.Cartesian3.add(c,l,s),s=t.Cartesian3.normalize(s,s);const u=t.Cartesian3.cross(o,s,Z);return t.Cartesian3.dot(c,u)<0&&(s=t.Cartesian3.negate(s,s)),s}const Q=p.Plane.fromPointNormal(t.Cartesian3.ZERO,t.Cartesian3.UNIT_Y),K=new t.Cartesian3,ee=new t.Cartesian3,te=new t.Cartesian3,ae=new t.Cartesian3,ne=new t.Cartesian3,ie=new t.Cartesian3,re=new t.Cartographic,se=new t.Cartographic,oe=new t.Cartographic;N.createGeometry=function(a){const o=!a._scene3DOnly;let p=a.loop;const d=a._ellipsoid,h=a.granularity,g=a.arcType,f=new L[a._projectionIndex](d),m=1e3;let w,y;const M=a._positions,T=M.length;let E,_,O,b;2===T&&(p=!1);const P=new l.EllipsoidRhumbLine(void 0,void 0,d);let k,S,I;const N=[M[0]];for(y=0;y<T-1;y++)E=M[y],_=M[y+1],k=C.IntersectionTests.lineSegmentPlane(E,_,Q,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||(a.arcType===r.ArcType.GEODESIC?N.push(t.Cartesian3.clone(k)):a.arcType===r.ArcType.RHUMB&&(I=d.cartesianToCartographic(k,re).longitude,O=d.cartesianToCartographic(E,re),b=d.cartesianToCartographic(_,se),P.setEndPoints(O,b),S=P.findIntersectionWithLongitude(I,oe),k=d.cartographicToCartesian(S,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||N.push(t.Cartesian3.clone(k)))),N.push(_);p&&(E=M[T-1],_=M[0],k=C.IntersectionTests.lineSegmentPlane(E,_,Q,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||(a.arcType===r.ArcType.GEODESIC?N.push(t.Cartesian3.clone(k)):a.arcType===r.ArcType.RHUMB&&(I=d.cartesianToCartographic(k,re).longitude,O=d.cartesianToCartographic(E,re),b=d.cartesianToCartographic(_,se),P.setEndPoints(O,b),S=P.findIntersectionWithLongitude(I,oe),k=d.cartographicToCartesian(S,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||N.push(t.Cartesian3.clone(k)))));let R=N.length,D=new Array(R);for(y=0;y<R;y++){const e=t.Cartographic.fromCartesian(N[y],d);e.height=0,D[y]=e}if(D=s.arrayRemoveDuplicates(D,t.Cartographic.equalsEpsilon),R=D.length,R<2)return;const v=[],H=[],j=[],B=[];let V=K,Y=ee,X=te,W=ae,U=ne;const Z=D[0],$=D[1];for(V=F(d,D[R-1],0,V),W=F(d,$,0,W),Y=F(d,Z,0,Y),X=F(d,Z,m,X),U=p?J(V,Y,X,W,U):z(Z,$,m,d,U),t.Cartesian3.pack(U,H,0),t.Cartesian3.pack(Y,j,0),t.Cartesian3.pack(X,B,0),v.push(Z.latitude),v.push(Z.longitude),G(Z,$,0,m,h,g,d,H,j,B,v),y=1;y<R-1;++y){V=t.Cartesian3.clone(Y,V),Y=t.Cartesian3.clone(W,Y);const e=D[y];F(d,e,m,X),F(d,D[y+1],0,W),J(V,Y,X,W,U),w=H.length,t.Cartesian3.pack(U,H,w),t.Cartesian3.pack(Y,j,w),t.Cartesian3.pack(X,B,w),v.push(e.latitude),v.push(e.longitude),G(D[y],D[y+1],0,m,h,g,d,H,j,B,v)}const le=D[R-1],ce=D[R-2];if(Y=F(d,le,0,Y),X=F(d,le,m,X),p){const e=D[0];V=F(d,ce,0,V),W=F(d,e,0,W),U=J(V,Y,X,W,U)}else U=z(ce,le,m,d,U);if(w=H.length,t.Cartesian3.pack(U,H,w),t.Cartesian3.pack(Y,j,w),t.Cartesian3.pack(X,B,w),v.push(le.latitude),v.push(le.longitude),p){for(G(le,Z,0,m,h,g,d,H,j,B,v),w=H.length,y=0;y<3;++y)H[w+y]=H[y],j[w+y]=j[y],B[w+y]=B[y];v.push(Z.latitude),v.push(Z.longitude)}return function(a,n,r,s,o,l,C){let p,d;const h=n._ellipsoid,g=r.length/3-1,f=8*g,m=4*f,w=36*g,y=f>65535?new Uint32Array(w):new Uint16Array(w),M=new Float64Array(3*f),T=new Float32Array(m),E=new Float32Array(m),_=new Float32Array(m),O=new Float32Array(m),b=new Float32Array(m);let P,k,L,S;C&&(P=new Float32Array(m),k=new Float32Array(m),L=new Float32Array(m),S=new Float32Array(2*f));const I=l.length/2;let N=0;const R=Ee;R.height=0;const D=_e;D.height=0;let v=Oe,z=be;if(C)for(d=0,p=1;p<I;p++)R.latitude=l[d],R.longitude=l[d+1],D.latitude=l[d+2],D.longitude=l[d+3],v=n.project(R,v),z=n.project(D,z),N+=t.Cartesian3.distance(v,z),d+=2;const H=s.length/3;z=t.Cartesian3.unpack(s,0,z);let j,B=0;for(d=3,p=1;p<H;p++)v=t.Cartesian3.clone(z,v),z=t.Cartesian3.unpack(s,d,z),B+=t.Cartesian3.distance(v,z),d+=3;d=3;let V=0,G=0,Y=0,F=0,X=!1,W=t.Cartesian3.unpack(r,0,Ae),U=t.Cartesian3.unpack(s,0,be),Z=t.Cartesian3.unpack(o,0,Le);if(a){Ce(Z,t.Cartesian3.unpack(r,r.length-6,Pe),W,U)&&(Z=t.Cartesian3.negate(Z,Z))}let $=0,J=0,Q=0;for(p=0;p<g;p++){const e=t.Cartesian3.clone(W,Pe),a=t.Cartesian3.clone(U,Oe);let u,p,g,f,m=t.Cartesian3.clone(Z,ke);if(X&&(m=t.Cartesian3.negate(m,m)),W=t.Cartesian3.unpack(r,d,Ae),U=t.Cartesian3.unpack(s,d,be),Z=t.Cartesian3.unpack(o,d,Le),X=Ce(Z,e,W,U),R.latitude=l[V],R.longitude=l[V+1],D.latitude=l[V+2],D.longitude=l[V+3],C){const e=Te(R,D);u=n.project(R,ve),p=n.project(D,ze);const a=q(p,u,Ue);a.y=Math.abs(a.y),g=He,f=je,0===e||t.Cartesian3.dot(a,t.Cartesian3.UNIT_Y)>x?(g=ge(n,R,m,u,He),f=ge(n,D,Z,p,je)):1===e?(f=ge(n,D,Z,p,je),g.x=0,g.y=i.CesiumMath.sign(R.longitude-Math.abs(D.longitude)),g.z=0):(g=ge(n,R,m,u,He),f.x=0,f.y=i.CesiumMath.sign(R.longitude-D.longitude),f.z=0)}const w=t.Cartesian3.distance(a,U),y=c.EncodedCartesian3.fromCartesian(e,Xe),I=t.Cartesian3.subtract(W,e,Be),v=t.Cartesian3.normalize(I,Ye);let z=t.Cartesian3.subtract(a,e,Ve);z=t.Cartesian3.normalize(z,z);let H=t.Cartesian3.cross(v,z,Ye);H=t.Cartesian3.normalize(H,H);let K=t.Cartesian3.cross(z,m,Fe);K=t.Cartesian3.normalize(K,K);let ee=t.Cartesian3.subtract(U,W,Ge);ee=t.Cartesian3.normalize(ee,ee);let te=t.Cartesian3.cross(Z,ee,qe);te=t.Cartesian3.normalize(te,te);const ae=w/B,ne=$/B;let ie,re,se,oe=0,le=0,ce=0;if(C){oe=t.Cartesian3.distance(u,p),ie=c.EncodedCartesian3.fromCartesian(u,We),re=t.Cartesian3.subtract(p,u,Ue),se=t.Cartesian3.normalize(re,Ze);const e=se.x;se.x=se.y,se.y=-e,le=oe/N,ce=J/N}for(j=0;j<8;j++){const e=F+4*j,a=G+2*j,n=e+3,i=j<4?1:-1,r=2===j||3===j||6===j||7===j?1:-1;t.Cartesian3.pack(y.high,T,e),T[n]=I.x,t.Cartesian3.pack(y.low,E,e),E[n]=I.y,t.Cartesian3.pack(K,_,e),_[n]=I.z,t.Cartesian3.pack(te,O,e),O[n]=ae*i,t.Cartesian3.pack(H,b,e);let s=ne*r;0===s&&r<0&&(s=9),b[n]=s,C&&(P[e]=ie.high.x,P[e+1]=ie.high.y,P[e+2]=ie.low.x,P[e+3]=ie.low.y,L[e]=-g.y,L[e+1]=g.x,L[e+2]=f.y,L[e+3]=-f.x,k[e]=re.x,k[e+1]=re.y,k[e+2]=se.x,k[e+3]=se.y,S[a]=le*i,s=ce*r,0===s&&r<0&&(s=9),S[a+1]=s)}const ue=Re,pe=De,de=Ie,he=Ne,fe=t.Rectangle.fromCartographicArray(Se,xe),me=A.getMinimumMaximumHeights(fe,h),ye=me.minimumTerrainHeight,Ee=me.maximumTerrainHeight;Q+=ye,Q+=Ee,we(e,a,ye,Ee,ue,de),we(W,U,ye,Ee,pe,he);let _e=t.Cartesian3.multiplyByScalar(H,i.CesiumMath.EPSILON5,$e);t.Cartesian3.add(ue,_e,ue),t.Cartesian3.add(pe,_e,pe),t.Cartesian3.add(de,_e,de),t.Cartesian3.add(he,_e,he),Me(ue,pe),Me(de,he),t.Cartesian3.pack(ue,M,Y),t.Cartesian3.pack(pe,M,Y+3),t.Cartesian3.pack(he,M,Y+6),t.Cartesian3.pack(de,M,Y+9),_e=t.Cartesian3.multiplyByScalar(H,-2*i.CesiumMath.EPSILON5,$e),t.Cartesian3.add(ue,_e,ue),t.Cartesian3.add(pe,_e,pe),t.Cartesian3.add(de,_e,de),t.Cartesian3.add(he,_e,he),Me(ue,pe),Me(de,he),t.Cartesian3.pack(ue,M,Y+12),t.Cartesian3.pack(pe,M,Y+15),t.Cartesian3.pack(he,M,Y+18),t.Cartesian3.pack(de,M,Y+21),V+=2,d+=3,G+=16,Y+=24,F+=32,$+=w,J+=oe}d=0;let K=0;for(p=0;p<g;p++){for(j=0;j<Ke;j++)y[d+j]=Qe[j]+K;K+=8,d+=Ke}const ee=Je;e.BoundingSphere.fromVertices(r,t.Cartesian3.ZERO,3,ee[0]),e.BoundingSphere.fromVertices(s,t.Cartesian3.ZERO,3,ee[1]);const te=e.BoundingSphere.fromBoundingSpheres(ee);te.radius+=Q/(2*g);const ae={position:new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:M}),startHiAndForwardOffsetX:et(T),startLoAndForwardOffsetY:et(E),startNormalAndForwardOffsetZ:et(_),endNormalAndTextureCoordinateNormalizationX:et(O),rightNormalAndTextureCoordinateNormalizationY:et(b)};C&&(ae.startHiLo2D=et(P),ae.offsetAndRight2D=et(k),ae.startEndNormals2D=et(L),ae.texcoordNormalization2D=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:S}));return new u.Geometry({attributes:ae,indices:y,boundingSphere:te})}(p,f,j,B,H,v,o)};const le=new t.Cartesian3,ce=new t.Matrix3,ue=new e.Quaternion;function Ce(a,n,r,s){const o=q(r,n,le),l=t.Cartesian3.dot(o,a);if(l>x||l<I){const n=q(s,r,$),o=l<I?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,ue),u=t.Matrix3.fromQuaternion(c,ce);return t.Matrix3.multiplyByVector(u,a,a),!0}return!1}const pe=new t.Cartographic,de=new t.Cartesian3,he=new t.Cartesian3;function ge(e,a,n,r,s){const o=t.Cartographic.toCartesian(a,e._ellipsoid,de);let l=t.Cartesian3.add(o,n,he),c=!1;const u=e._ellipsoid;let C=u.cartesianToCartographic(l,pe);Math.abs(a.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=t.Cartesian3.subtract(o,n,he),C=u.cartesianToCartographic(l,pe)),C.height=0;const p=e.project(C,s);return(s=t.Cartesian3.subtract(p,r,s)).z=0,s=t.Cartesian3.normalize(s,s),c&&t.Cartesian3.negate(s,s),s}const fe=new t.Cartesian3,me=new t.Cartesian3;function we(e,a,n,i,r,s){const o=t.Cartesian3.subtract(a,e,fe);t.Cartesian3.normalize(o,o);const l=n-0;let c=t.Cartesian3.multiplyByScalar(o,l,me);t.Cartesian3.add(e,c,r);const u=i-1e3;c=t.Cartesian3.multiplyByScalar(o,u,me),t.Cartesian3.add(a,c,s)}const ye=new t.Cartesian3;function Me(e,a){const n=p.Plane.getPointDistance(Q,e),r=p.Plane.getPointDistance(Q,a);let s=ye;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=q(a,e,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=q(e,a,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(a,s,a))}function Te(e,t){const a=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const n=i.CesiumMath.sign(t.longitude);return e.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const a=i.CesiumMath.sign(e.longitude);return t.longitude=a*(n-i.CesiumMath.EPSILON11),2}return 0}const Ee=new t.Cartographic,_e=new t.Cartographic,Oe=new t.Cartesian3,be=new t.Cartesian3,Pe=new t.Cartesian3,Ae=new t.Cartesian3,ke=new t.Cartesian3,Le=new t.Cartesian3,Se=[Ee,_e],xe=new t.Rectangle,Ie=new t.Cartesian3,Ne=new t.Cartesian3,Re=new t.Cartesian3,De=new t.Cartesian3,ve=new t.Cartesian3,ze=new t.Cartesian3,He=new t.Cartesian3,je=new t.Cartesian3,Be=new t.Cartesian3,Ve=new t.Cartesian3,Ge=new t.Cartesian3,Ye=new t.Cartesian3,Fe=new t.Cartesian3,qe=new t.Cartesian3,Xe=new c.EncodedCartesian3,We=new c.EncodedCartesian3,Ue=new t.Cartesian3,Ze=new t.Cartesian3,$e=new t.Cartesian3,Je=[new e.BoundingSphere,new e.BoundingSphere],Qe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Ke=Qe.length;function et(e){return new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return N._projectNormal=ge,function(e,t){return A.initialize().then((function(){return n.defined(t)&&(e=N.unpack(e,t)),N.createGeometry(e)}))}})); | ||
define(["./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./ComponentDatatype-07fbb0d4","./ArcType-e1641d8d","./arrayRemoveDuplicates-7d5d09a3","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./EncodedCartesian3-8da855cc","./GeometryAttribute-d50ea0de","./IntersectionTests-4547e13f","./Plane-faef0199","./WebMercatorProjection-7e95daf8","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,a,n,i,r,s,o,l,c,u,C,d,p,h,g,f){"use strict";function m(a){a=n.defaultValue(a,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84),this._rectangle=n.defaultValue(a.rectangle,t.Rectangle.MAX_VALUE),this._projection=new e.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(a.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(a.numberOfLevelZeroTilesY,1)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),m.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},m.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},m.prototype.rectangleToNativeRectangle=function(e,a){const r=i.CesiumMath.toDegrees(e.west),s=i.CesiumMath.toDegrees(e.south),o=i.CesiumMath.toDegrees(e.east),l=i.CesiumMath.toDegrees(e.north);return n.defined(a)?(a.west=r,a.south=s,a.east=o,a.north=l,a):new t.Rectangle(r,s,o,l)},m.prototype.tileXYToNativeRectangle=function(e,t,a,n){const r=this.tileXYToRectangle(e,t,a,n);return r.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},m.prototype.tileXYToRectangle=function(e,a,i,r){const s=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,d=s.height/l,p=s.north-a*d,h=s.north-(a+1)*d;return n.defined(r)||(r=new t.Rectangle(u,h,C,p)),r.west=u,r.south=h,r.east=C,r.north=p,r},m.prototype.positionToTileXY=function(e,a,r){const s=this._rectangle;if(!t.Rectangle.contains(s,e))return;const o=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;let C=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);let d=(C-s.west)/c|0;d>=o&&(d=o-1);let p=(s.north-e.latitude)/u|0;return p>=l&&(p=l-1),n.defined(r)?(r.x=d,r.y=p,r):new t.Cartesian2(d,p)};const w=new t.Cartesian3,y=new t.Cartesian3,M=new t.Cartographic,T=new t.Cartesian3,E=new t.Cartesian3,_=new e.BoundingSphere,O=new m,b=[new t.Cartographic,new t.Cartographic,new t.Cartographic,new t.Cartographic],P=new t.Cartesian2,A={};function k(e){t.Cartographic.fromRadians(e.east,e.north,0,b[0]),t.Cartographic.fromRadians(e.west,e.north,0,b[1]),t.Cartographic.fromRadians(e.east,e.south,0,b[2]),t.Cartographic.fromRadians(e.west,e.south,0,b[3]);let a=0,n=0,i=0,r=0;const s=A._terrainHeightsMaxLevel;let o;for(o=0;o<=s;++o){let e=!1;for(let t=0;t<4;++t){const a=b[t];if(O.positionToTileXY(a,o,P),0===t)i=P.x,r=P.y;else if(i!==P.x||r!==P.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}}A.initialize=function(){let t=A._initPromise;return n.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){A._terrainHeights=e})),A._initPromise=t),t},A.getMinimumMaximumHeights=function(e,a){a=n.defaultValue(a,t.Ellipsoid.WGS84);const i=k(e);let r=A._defaultMinTerrainHeight,s=A._defaultMaxTerrainHeight;if(n.defined(i)){const o=`${i.level}-${i.x}-${i.y}`,l=A._terrainHeights[o];n.defined(l)&&(r=l[0],s=l[1]),a.cartographicToCartesian(t.Rectangle.northeast(e,M),w),a.cartographicToCartesian(t.Rectangle.southwest(e,M),y),t.Cartesian3.midpoint(y,w,T);const c=a.scaleToGeodeticSurface(T,E);if(n.defined(c)){const e=t.Cartesian3.distance(T,c);r=Math.min(r,-e)}else r=A._defaultMinTerrainHeight}return r=Math.max(A._defaultMinTerrainHeight,r),{minimumTerrainHeight:r,maximumTerrainHeight:s}},A.getBoundingSphere=function(a,i){i=n.defaultValue(i,t.Ellipsoid.WGS84);const r=k(a);let s=A._defaultMaxTerrainHeight;if(n.defined(r)){const e=`${r.level}-${r.x}-${r.y}`,t=A._terrainHeights[e];n.defined(t)&&(s=t[1])}const o=e.BoundingSphere.fromRectangle3D(a,i,0);return e.BoundingSphere.fromRectangle3D(a,i,s,_),e.BoundingSphere.union(o,_,o)},A._terrainHeightsMaxLevel=6,A._defaultMaxTerrainHeight=9e3,A._defaultMinTerrainHeight=-1e5,A._terrainHeights=void 0,A._initPromise=void 0,Object.defineProperties(A,{initialized:{get:function(){return n.defined(A._terrainHeights)}}});const L=[e.GeographicProjection,p.WebMercatorProjection],S=L.length,x=Math.cos(i.CesiumMath.toRadians(30)),I=Math.cos(i.CesiumMath.toRadians(150));function N(e){const a=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).positions;this.width=n.defaultValue(e.width,1),this._positions=a,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=t.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(N.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+t.Ellipsoid.packedLength+1+1}}}),N.setProjectionAndEllipsoid=function(e,t){let a=0;for(let e=0;e<S;e++)if(t instanceof L[e]){a=e;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};const R=new t.Cartesian3,D=new t.Cartesian3,v=new t.Cartesian3;function z(e,a,n,i,r){const s=F(i,e,0,R),o=F(i,e,n,D),l=F(i,a,0,v),c=q(o,s,D),u=q(l,s,v);return t.Cartesian3.cross(u,c,r),t.Cartesian3.normalize(r,r)}const H=new t.Cartographic,j=new t.Cartesian3,B=new t.Cartesian3,V=new t.Cartesian3;function G(e,a,n,i,s,c,u,C,d,p,h){if(0===s)return;let g;c===r.ArcType.GEODESIC?g=new o.EllipsoidGeodesic(e,a,u):c===r.ArcType.RHUMB&&(g=new l.EllipsoidRhumbLine(e,a,u));const f=g.surfaceDistance;if(f<s)return;const m=z(e,a,i,u,V),w=Math.ceil(f/s),y=f/w;let M=y;const T=w-1;let E=C.length;for(let e=0;e<T;e++){const e=g.interpolateUsingSurfaceDistance(M,H),a=F(u,e,n,j),r=F(u,e,i,B);t.Cartesian3.pack(m,C,E),t.Cartesian3.pack(a,d,E),t.Cartesian3.pack(r,p,E),h.push(e.latitude),h.push(e.longitude),E+=3,M+=y}}const Y=new t.Cartographic;function F(e,a,n,i){return t.Cartographic.clone(a,Y),Y.height=n,t.Cartographic.toCartesian(Y,e,i)}function q(e,a,n){return t.Cartesian3.subtract(e,a,n),t.Cartesian3.normalize(n,n),n}function X(e,a,n,i){return i=q(e,a,i),i=t.Cartesian3.cross(i,n,i),i=t.Cartesian3.normalize(i,i),i=t.Cartesian3.cross(n,i,i)}N.pack=function(e,a,i){let r=n.defaultValue(i,0);const s=e._positions,o=s.length;a[r++]=o;for(let e=0;e<o;++e){const n=s[e];t.Cartesian3.pack(n,a,r),r+=3}return a[r++]=e.granularity,a[r++]=e.loop?1:0,a[r++]=e.arcType,t.Ellipsoid.pack(e._ellipsoid,a,r),r+=t.Ellipsoid.packedLength,a[r++]=e._projectionIndex,a[r++]=e._scene3DOnly?1:0,a},N.unpack=function(e,a,i){let r=n.defaultValue(a,0);const s=e[r++],o=new Array(s);for(let a=0;a<s;a++)o[a]=t.Cartesian3.unpack(e,r),r+=3;const l=e[r++],c=1===e[r++],u=e[r++],C=t.Ellipsoid.unpack(e,r);r+=t.Ellipsoid.packedLength;const d=e[r++],p=1===e[r++];return n.defined(i)||(i=new N({positions:o})),i._positions=o,i.granularity=l,i.loop=c,i.arcType=u,i._ellipsoid=C,i._projectionIndex=d,i._scene3DOnly=p,i};const W=new t.Cartesian3,U=new t.Cartesian3,Z=new t.Cartesian3,$=new t.Cartesian3;function J(e,a,n,r,s){const o=q(n,a,$),l=X(e,a,o,W),c=X(r,a,o,U);if(i.CesiumMath.equalsEpsilon(t.Cartesian3.dot(l,c),-1,i.CesiumMath.EPSILON5))return s=t.Cartesian3.cross(o,l,s),s=t.Cartesian3.normalize(s,s);s=t.Cartesian3.add(c,l,s),s=t.Cartesian3.normalize(s,s);const u=t.Cartesian3.cross(o,s,Z);return t.Cartesian3.dot(c,u)<0&&(s=t.Cartesian3.negate(s,s)),s}const Q=d.Plane.fromPointNormal(t.Cartesian3.ZERO,t.Cartesian3.UNIT_Y),K=new t.Cartesian3,ee=new t.Cartesian3,te=new t.Cartesian3,ae=new t.Cartesian3,ne=new t.Cartesian3,ie=new t.Cartesian3,re=new t.Cartographic,se=new t.Cartographic,oe=new t.Cartographic;N.createGeometry=function(a){const o=!a._scene3DOnly;let d=a.loop;const p=a._ellipsoid,h=a.granularity,g=a.arcType,f=new L[a._projectionIndex](p),m=1e3;let w,y;const M=a._positions,T=M.length;let E,_,O,b;2===T&&(d=!1);const P=new l.EllipsoidRhumbLine(void 0,void 0,p);let k,S,I;const N=[M[0]];for(y=0;y<T-1;y++)E=M[y],_=M[y+1],k=C.IntersectionTests.lineSegmentPlane(E,_,Q,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||(a.arcType===r.ArcType.GEODESIC?N.push(t.Cartesian3.clone(k)):a.arcType===r.ArcType.RHUMB&&(I=p.cartesianToCartographic(k,re).longitude,O=p.cartesianToCartographic(E,re),b=p.cartesianToCartographic(_,se),P.setEndPoints(O,b),S=P.findIntersectionWithLongitude(I,oe),k=p.cartographicToCartesian(S,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||N.push(t.Cartesian3.clone(k)))),N.push(_);d&&(E=M[T-1],_=M[0],k=C.IntersectionTests.lineSegmentPlane(E,_,Q,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||(a.arcType===r.ArcType.GEODESIC?N.push(t.Cartesian3.clone(k)):a.arcType===r.ArcType.RHUMB&&(I=p.cartesianToCartographic(k,re).longitude,O=p.cartesianToCartographic(E,re),b=p.cartesianToCartographic(_,se),P.setEndPoints(O,b),S=P.findIntersectionWithLongitude(I,oe),k=p.cartographicToCartesian(S,ie),!n.defined(k)||t.Cartesian3.equalsEpsilon(k,E,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(k,_,i.CesiumMath.EPSILON7)||N.push(t.Cartesian3.clone(k)))));let R=N.length,D=new Array(R);for(y=0;y<R;y++){const e=t.Cartographic.fromCartesian(N[y],p);e.height=0,D[y]=e}if(D=s.arrayRemoveDuplicates(D,t.Cartographic.equalsEpsilon),R=D.length,R<2)return;const v=[],H=[],j=[],B=[];let V=K,Y=ee,X=te,W=ae,U=ne;const Z=D[0],$=D[1];for(V=F(p,D[R-1],0,V),W=F(p,$,0,W),Y=F(p,Z,0,Y),X=F(p,Z,m,X),U=d?J(V,Y,X,W,U):z(Z,$,m,p,U),t.Cartesian3.pack(U,H,0),t.Cartesian3.pack(Y,j,0),t.Cartesian3.pack(X,B,0),v.push(Z.latitude),v.push(Z.longitude),G(Z,$,0,m,h,g,p,H,j,B,v),y=1;y<R-1;++y){V=t.Cartesian3.clone(Y,V),Y=t.Cartesian3.clone(W,Y);const e=D[y];F(p,e,m,X),F(p,D[y+1],0,W),J(V,Y,X,W,U),w=H.length,t.Cartesian3.pack(U,H,w),t.Cartesian3.pack(Y,j,w),t.Cartesian3.pack(X,B,w),v.push(e.latitude),v.push(e.longitude),G(D[y],D[y+1],0,m,h,g,p,H,j,B,v)}const le=D[R-1],ce=D[R-2];if(Y=F(p,le,0,Y),X=F(p,le,m,X),d){const e=D[0];V=F(p,ce,0,V),W=F(p,e,0,W),U=J(V,Y,X,W,U)}else U=z(ce,le,m,p,U);if(w=H.length,t.Cartesian3.pack(U,H,w),t.Cartesian3.pack(Y,j,w),t.Cartesian3.pack(X,B,w),v.push(le.latitude),v.push(le.longitude),d){for(G(le,Z,0,m,h,g,p,H,j,B,v),w=H.length,y=0;y<3;++y)H[w+y]=H[y],j[w+y]=j[y],B[w+y]=B[y];v.push(Z.latitude),v.push(Z.longitude)}return function(a,n,r,s,o,l,C){let d,p;const h=n._ellipsoid,g=r.length/3-1,f=8*g,m=4*f,w=36*g,y=f>65535?new Uint32Array(w):new Uint16Array(w),M=new Float64Array(3*f),T=new Float32Array(m),E=new Float32Array(m),_=new Float32Array(m),O=new Float32Array(m),b=new Float32Array(m);let P,k,L,S;C&&(P=new Float32Array(m),k=new Float32Array(m),L=new Float32Array(m),S=new Float32Array(2*f));const I=l.length/2;let N=0;const R=Ee;R.height=0;const D=_e;D.height=0;let v=Oe,z=be;if(C)for(p=0,d=1;d<I;d++)R.latitude=l[p],R.longitude=l[p+1],D.latitude=l[p+2],D.longitude=l[p+3],v=n.project(R,v),z=n.project(D,z),N+=t.Cartesian3.distance(v,z),p+=2;const H=s.length/3;z=t.Cartesian3.unpack(s,0,z);let j,B=0;for(p=3,d=1;d<H;d++)v=t.Cartesian3.clone(z,v),z=t.Cartesian3.unpack(s,p,z),B+=t.Cartesian3.distance(v,z),p+=3;p=3;let V=0,G=0,Y=0,F=0,X=!1,W=t.Cartesian3.unpack(r,0,Ae),U=t.Cartesian3.unpack(s,0,be),Z=t.Cartesian3.unpack(o,0,Le);if(a){Ce(Z,t.Cartesian3.unpack(r,r.length-6,Pe),W,U)&&(Z=t.Cartesian3.negate(Z,Z))}let $=0,J=0,Q=0;for(d=0;d<g;d++){const e=t.Cartesian3.clone(W,Pe),a=t.Cartesian3.clone(U,Oe);let u,d,g,f,m=t.Cartesian3.clone(Z,ke);if(X&&(m=t.Cartesian3.negate(m,m)),W=t.Cartesian3.unpack(r,p,Ae),U=t.Cartesian3.unpack(s,p,be),Z=t.Cartesian3.unpack(o,p,Le),X=Ce(Z,e,W,U),R.latitude=l[V],R.longitude=l[V+1],D.latitude=l[V+2],D.longitude=l[V+3],C){const e=Te(R,D);u=n.project(R,ve),d=n.project(D,ze);const a=q(d,u,Ue);a.y=Math.abs(a.y),g=He,f=je,0===e||t.Cartesian3.dot(a,t.Cartesian3.UNIT_Y)>x?(g=ge(n,R,m,u,He),f=ge(n,D,Z,d,je)):1===e?(f=ge(n,D,Z,d,je),g.x=0,g.y=i.CesiumMath.sign(R.longitude-Math.abs(D.longitude)),g.z=0):(g=ge(n,R,m,u,He),f.x=0,f.y=i.CesiumMath.sign(R.longitude-D.longitude),f.z=0)}const w=t.Cartesian3.distance(a,U),y=c.EncodedCartesian3.fromCartesian(e,Xe),I=t.Cartesian3.subtract(W,e,Be),v=t.Cartesian3.normalize(I,Ye);let z=t.Cartesian3.subtract(a,e,Ve);z=t.Cartesian3.normalize(z,z);let H=t.Cartesian3.cross(v,z,Ye);H=t.Cartesian3.normalize(H,H);let K=t.Cartesian3.cross(z,m,Fe);K=t.Cartesian3.normalize(K,K);let ee=t.Cartesian3.subtract(U,W,Ge);ee=t.Cartesian3.normalize(ee,ee);let te=t.Cartesian3.cross(Z,ee,qe);te=t.Cartesian3.normalize(te,te);const ae=w/B,ne=$/B;let ie,re,se,oe=0,le=0,ce=0;if(C){oe=t.Cartesian3.distance(u,d),ie=c.EncodedCartesian3.fromCartesian(u,We),re=t.Cartesian3.subtract(d,u,Ue),se=t.Cartesian3.normalize(re,Ze);const e=se.x;se.x=se.y,se.y=-e,le=oe/N,ce=J/N}for(j=0;j<8;j++){const e=F+4*j,a=G+2*j,n=e+3,i=j<4?1:-1,r=2===j||3===j||6===j||7===j?1:-1;t.Cartesian3.pack(y.high,T,e),T[n]=I.x,t.Cartesian3.pack(y.low,E,e),E[n]=I.y,t.Cartesian3.pack(K,_,e),_[n]=I.z,t.Cartesian3.pack(te,O,e),O[n]=ae*i,t.Cartesian3.pack(H,b,e);let s=ne*r;0===s&&r<0&&(s=9),b[n]=s,C&&(P[e]=ie.high.x,P[e+1]=ie.high.y,P[e+2]=ie.low.x,P[e+3]=ie.low.y,L[e]=-g.y,L[e+1]=g.x,L[e+2]=f.y,L[e+3]=-f.x,k[e]=re.x,k[e+1]=re.y,k[e+2]=se.x,k[e+3]=se.y,S[a]=le*i,s=ce*r,0===s&&r<0&&(s=9),S[a+1]=s)}const ue=Re,de=De,pe=Ie,he=Ne,fe=t.Rectangle.fromCartographicArray(Se,xe),me=A.getMinimumMaximumHeights(fe,h),ye=me.minimumTerrainHeight,Ee=me.maximumTerrainHeight;Q+=ye,Q+=Ee,we(e,a,ye,Ee,ue,pe),we(W,U,ye,Ee,de,he);let _e=t.Cartesian3.multiplyByScalar(H,i.CesiumMath.EPSILON5,$e);t.Cartesian3.add(ue,_e,ue),t.Cartesian3.add(de,_e,de),t.Cartesian3.add(pe,_e,pe),t.Cartesian3.add(he,_e,he),Me(ue,de),Me(pe,he),t.Cartesian3.pack(ue,M,Y),t.Cartesian3.pack(de,M,Y+3),t.Cartesian3.pack(he,M,Y+6),t.Cartesian3.pack(pe,M,Y+9),_e=t.Cartesian3.multiplyByScalar(H,-2*i.CesiumMath.EPSILON5,$e),t.Cartesian3.add(ue,_e,ue),t.Cartesian3.add(de,_e,de),t.Cartesian3.add(pe,_e,pe),t.Cartesian3.add(he,_e,he),Me(ue,de),Me(pe,he),t.Cartesian3.pack(ue,M,Y+12),t.Cartesian3.pack(de,M,Y+15),t.Cartesian3.pack(he,M,Y+18),t.Cartesian3.pack(pe,M,Y+21),V+=2,p+=3,G+=16,Y+=24,F+=32,$+=w,J+=oe}p=0;let K=0;for(d=0;d<g;d++){for(j=0;j<Ke;j++)y[p+j]=Qe[j]+K;K+=8,p+=Ke}const ee=Je;e.BoundingSphere.fromVertices(r,t.Cartesian3.ZERO,3,ee[0]),e.BoundingSphere.fromVertices(s,t.Cartesian3.ZERO,3,ee[1]);const te=e.BoundingSphere.fromBoundingSpheres(ee);te.radius+=Q/(2*g);const ae={position:new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:M}),startHiAndForwardOffsetX:et(T),startLoAndForwardOffsetY:et(E),startNormalAndForwardOffsetZ:et(_),endNormalAndTextureCoordinateNormalizationX:et(O),rightNormalAndTextureCoordinateNormalizationY:et(b)};C&&(ae.startHiLo2D=et(P),ae.offsetAndRight2D=et(k),ae.startEndNormals2D=et(L),ae.texcoordNormalization2D=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:S}));return new u.Geometry({attributes:ae,indices:y,boundingSphere:te})}(d,f,j,B,H,v,o)};const le=new t.Cartesian3,ce=new t.Matrix3,ue=new e.Quaternion;function Ce(a,n,r,s){const o=q(r,n,le),l=t.Cartesian3.dot(o,a);if(l>x||l<I){const n=q(s,r,$),o=l<I?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,ue),u=t.Matrix3.fromQuaternion(c,ce);return t.Matrix3.multiplyByVector(u,a,a),!0}return!1}const de=new t.Cartographic,pe=new t.Cartesian3,he=new t.Cartesian3;function ge(e,a,n,r,s){const o=t.Cartographic.toCartesian(a,e._ellipsoid,pe);let l=t.Cartesian3.add(o,n,he),c=!1;const u=e._ellipsoid;let C=u.cartesianToCartographic(l,de);Math.abs(a.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=t.Cartesian3.subtract(o,n,he),C=u.cartesianToCartographic(l,de)),C.height=0;const d=e.project(C,s);return(s=t.Cartesian3.subtract(d,r,s)).z=0,s=t.Cartesian3.normalize(s,s),c&&t.Cartesian3.negate(s,s),s}const fe=new t.Cartesian3,me=new t.Cartesian3;function we(e,a,n,i,r,s){const o=t.Cartesian3.subtract(a,e,fe);t.Cartesian3.normalize(o,o);const l=n-0;let c=t.Cartesian3.multiplyByScalar(o,l,me);t.Cartesian3.add(e,c,r);const u=i-1e3;c=t.Cartesian3.multiplyByScalar(o,u,me),t.Cartesian3.add(a,c,s)}const ye=new t.Cartesian3;function Me(e,a){const n=d.Plane.getPointDistance(Q,e),r=d.Plane.getPointDistance(Q,a);let s=ye;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=q(a,e,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=q(e,a,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(a,s,a))}function Te(e,t){const a=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const n=i.CesiumMath.sign(t.longitude);return e.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){const a=i.CesiumMath.sign(e.longitude);return t.longitude=a*(n-i.CesiumMath.EPSILON11),2}return 0}const Ee=new t.Cartographic,_e=new t.Cartographic,Oe=new t.Cartesian3,be=new t.Cartesian3,Pe=new t.Cartesian3,Ae=new t.Cartesian3,ke=new t.Cartesian3,Le=new t.Cartesian3,Se=[Ee,_e],xe=new t.Rectangle,Ie=new t.Cartesian3,Ne=new t.Cartesian3,Re=new t.Cartesian3,De=new t.Cartesian3,ve=new t.Cartesian3,ze=new t.Cartesian3,He=new t.Cartesian3,je=new t.Cartesian3,Be=new t.Cartesian3,Ve=new t.Cartesian3,Ge=new t.Cartesian3,Ye=new t.Cartesian3,Fe=new t.Cartesian3,qe=new t.Cartesian3,Xe=new c.EncodedCartesian3,We=new c.EncodedCartesian3,Ue=new t.Cartesian3,Ze=new t.Cartesian3,$e=new t.Cartesian3,Je=[new e.BoundingSphere,new e.BoundingSphere],Qe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Ke=Qe.length;function et(e){return new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return N._projectNormal=ge,function(e,t){return A.initialize().then((function(){return n.defined(t)&&(e=N.unpack(e,t)),N.createGeometry(e)}))}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,r,a,o,i,m,u,c,p){"use strict";function s(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);const n=e.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}s.packedLength=m.VertexFormat.packedLength,s.pack=function(t,n,r){return r=e.defaultValue(r,0),m.VertexFormat.pack(t._vertexFormat,n,r),n};const y=new m.VertexFormat,l={vertexFormat:y};s.unpack=function(t,n,r){n=e.defaultValue(n,0);const a=m.VertexFormat.unpack(t,n,y);return e.defined(r)?(r._vertexFormat=m.VertexFormat.clone(a,r._vertexFormat),r):new s(l)};const f=new n.Cartesian3(-.5,-.5,0),A=new n.Cartesian3(.5,.5,0);return s.createGeometry=function(e){const r=e._vertexFormat,m=new i.GeometryAttributes;let u,c;if(r.position){if(c=new Float64Array(12),c[0]=f.x,c[1]=f.y,c[2]=0,c[3]=A.x,c[4]=f.y,c[5]=0,c[6]=A.x,c[7]=A.y,c[8]=0,c[9]=f.x,c[10]=A.y,c[11]=0,m.position=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),r.normal){const e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,m.normal=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.st){const e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,m.st=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e})}if(r.tangent){const e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,m.tangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.bitangent){const e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,m.bitangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}u=new Uint16Array(6),u[0]=0,u[1]=1,u[2]=2,u[3]=0,u[4]=2,u[5]=3}return new o.Geometry({attributes:m,indices:u,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=s.unpack(t,n)),s.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,r,a,o,i,m,u,c,p){"use strict";function s(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);const n=e.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT);this._vertexFormat=n,this._workerName="createPlaneGeometry"}s.packedLength=m.VertexFormat.packedLength,s.pack=function(t,n,r){return r=e.defaultValue(r,0),m.VertexFormat.pack(t._vertexFormat,n,r),n};const y=new m.VertexFormat,f={vertexFormat:y};s.unpack=function(t,n,r){n=e.defaultValue(n,0);const a=m.VertexFormat.unpack(t,n,y);return e.defined(r)?(r._vertexFormat=m.VertexFormat.clone(a,r._vertexFormat),r):new s(f)};const l=new n.Cartesian3(-.5,-.5,0),A=new n.Cartesian3(.5,.5,0);return s.createGeometry=function(e){const r=e._vertexFormat,m=new i.GeometryAttributes;let u,c;if(r.position){if(c=new Float64Array(12),c[0]=l.x,c[1]=l.y,c[2]=0,c[3]=A.x,c[4]=l.y,c[5]=0,c[6]=A.x,c[7]=A.y,c[8]=0,c[9]=l.x,c[10]=A.y,c[11]=0,m.position=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),r.normal){const e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,m.normal=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.st){const e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,m.st=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e})}if(r.tangent){const e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,m.tangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(r.bitangent){const e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,m.bitangent=new o.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}u=new Uint16Array(6),u[0]=0,u[1]=1,u[2]=2,u[3]=0,u[4]=2,u[5]=3}return new o.Geometry({attributes:m,indices:u,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=s.unpack(t,n)),s.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Transforms-06c05e21","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,r,a,i,o,u,c,s){"use strict";function m(){this._workerName="createPlaneOutlineGeometry"}m.packedLength=0,m.pack=function(e,t){return t},m.unpack=function(t,n,r){return e.defined(r)?r:new m};const y=new n.Cartesian3(-.5,-.5,0),p=new n.Cartesian3(.5,.5,0);return m.createGeometry=function(){const e=new o.GeometryAttributes,r=new Uint16Array(8),u=new Float64Array(12);return u[0]=y.x,u[1]=y.y,u[2]=y.z,u[3]=p.x,u[4]=y.y,u[5]=y.z,u[6]=p.x,u[7]=p.y,u[8]=y.z,u[9]=y.x,u[10]=p.y,u[11]=y.z,e.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),r[0]=0,r[1]=1,r[2]=1,r[3]=2,r[4]=2,r[5]=3,r[6]=3,r[7]=0,new i.Geometry({attributes:e,indices:r,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=m.unpack(t,n)),m.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc"],(function(e,t,n,r,a,i,o,u,c,s){"use strict";function m(){this._workerName="createPlaneOutlineGeometry"}m.packedLength=0,m.pack=function(e,t){return t},m.unpack=function(t,n,r){return e.defined(r)?r:new m};const y=new n.Cartesian3(-.5,-.5,0),f=new n.Cartesian3(.5,.5,0);return m.createGeometry=function(){const e=new o.GeometryAttributes,r=new Uint16Array(8),u=new Float64Array(12);return u[0]=y.x,u[1]=y.y,u[2]=y.z,u[3]=f.x,u[4]=y.y,u[5]=y.z,u[6]=f.x,u[7]=f.y,u[8]=y.z,u[9]=y.x,u[10]=f.y,u[11]=y.z,e.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),r[0]=0,r[1]=1,r[2]=1,r[3]=2,r[4]=2,r[5]=3,r[6]=3,r[7]=0,new i.Geometry({attributes:e,indices:r,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=m.unpack(t,n)),m.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./ArcType-e1641d8d","./GeometryOffsetAttribute-4d39b441","./BoundingRectangle-00ff5b29","./Transforms-06c05e21","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./EllipsoidGeodesic-f4459924","./EllipsoidTangentPlane-01395a15","./GeometryAttribute-b7edcc35","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonGeometryLibrary-a64b67ab","./PolygonPipeline-1015dc5c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./arrayRemoveDuplicates-fe254feb","./EllipsoidRhumbLine-94e77fa4","./GeometryAttributes-1b4134a9"],(function(e,t,o,i,n,r,a,s,l,c,u,p,m,y,g,d,h,f,b,_,P,x,C,w,T,I,A,E){"use strict";const v=new t.Cartographic,G=new t.Cartographic;function O(e,t,o,i){const n=i.cartesianToCartographic(e,v).height,r=i.cartesianToCartographic(t,G);r.height=n,i.cartographicToCartesian(r,t);const a=i.cartesianToCartographic(o,G);a.height=n-100,i.cartographicToCartesian(a,o)}const V=new n.BoundingRectangle,F=new t.Cartesian3,D=new t.Cartesian3,L=new t.Cartesian3,N=new t.Cartesian3,H=new t.Cartesian3,R=new t.Cartesian3;let M=new t.Cartesian3,S=new t.Cartesian3,B=new t.Cartesian3;const k=new t.Cartesian2,z=new t.Cartesian2,W=new t.Cartesian3,Y=new r.Quaternion,U=new t.Matrix3,j=new t.Matrix3;function Q(o){const n=o.vertexFormat,a=o.geometry,l=o.shadowVolume,c=a.attributes.position.values;let p=c.length;const m=o.wall,y=o.top||m,g=o.bottom||m;if(n.st||n.normal||n.tangent||n.bitangent||l){const e=o.boundingRectangle,i=o.tangentPlane,d=o.ellipsoid,h=o.stRotation,f=o.perPositionHeight,b=k;b.x=e.x,b.y=e.y;const _=n.st?new Float32Array(p/3*2):void 0;let P;n.normal&&(P=f&&y&&!m?a.attributes.normal.values:new Float32Array(p));const x=n.tangent?new Float32Array(p):void 0,C=n.bitangent?new Float32Array(p):void 0,w=l?new Float32Array(p):void 0;let T=0,I=0,A=D,E=L,v=N,G=!0,V=U,Q=j;if(0!==h){let e=r.Quaternion.fromAxisAngle(i._plane.normal,h,Y);V=t.Matrix3.fromQuaternion(e,V),e=r.Quaternion.fromAxisAngle(i._plane.normal,-h,Y),Q=t.Matrix3.fromQuaternion(e,Q)}else V=t.Matrix3.clone(t.Matrix3.IDENTITY,V),Q=t.Matrix3.clone(t.Matrix3.IDENTITY,Q);let q=0,K=0;y&&g&&(q=p/2,K=p/3,p/=2);for(let r=0;r<p;r+=3){const a=t.Cartesian3.fromArray(c,r,W);if(n.st){let o=t.Matrix3.multiplyByVector(V,a,F);o=d.scaleToGeodeticSurface(o,o);const n=i.projectPointOntoPlane(o,z);t.Cartesian2.subtract(n,b,n);const r=s.CesiumMath.clamp(n.x/e.width,0,1),l=s.CesiumMath.clamp(n.y/e.height,0,1);g&&(_[T+K]=r,_[T+1+K]=l),y&&(_[T]=r,_[T+1]=l),T+=2}if(n.normal||n.tangent||n.bitangent||l){const e=I+1,i=I+2;if(m){if(r+3<p){const e=t.Cartesian3.fromArray(c,r+3,H);if(G){const o=t.Cartesian3.fromArray(c,r+p,R);f&&O(a,e,o,d),t.Cartesian3.subtract(e,a,e),t.Cartesian3.subtract(o,a,o),A=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,A),A),G=!1}t.Cartesian3.equalsEpsilon(e,a,s.CesiumMath.EPSILON10)&&(G=!0)}(n.tangent||n.bitangent)&&(v=d.geodeticSurfaceNormal(a,v),n.tangent&&(E=t.Cartesian3.normalize(t.Cartesian3.cross(v,A,E),E)))}else A=d.geodeticSurfaceNormal(a,A),(n.tangent||n.bitangent)&&(f&&(M=t.Cartesian3.fromArray(P,I,M),S=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,S),S=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(Q,S,S),S),n.bitangent&&(B=t.Cartesian3.normalize(t.Cartesian3.cross(M,S,B),B))),E=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,A,E),E=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(Q,E,E),E),n.bitangent&&(v=t.Cartesian3.normalize(t.Cartesian3.cross(A,E,v),v)));n.normal&&(o.wall?(P[I+q]=A.x,P[e+q]=A.y,P[i+q]=A.z):g&&(P[I+q]=-A.x,P[e+q]=-A.y,P[i+q]=-A.z),(y&&!f||m)&&(P[I]=A.x,P[e]=A.y,P[i]=A.z)),l&&(m&&(A=d.geodeticSurfaceNormal(a,A)),w[I+q]=-A.x,w[e+q]=-A.y,w[i+q]=-A.z),n.tangent&&(o.wall?(x[I+q]=E.x,x[e+q]=E.y,x[i+q]=E.z):g&&(x[I+q]=-E.x,x[e+q]=-E.y,x[i+q]=-E.z),y&&(f?(x[I]=S.x,x[e]=S.y,x[i]=S.z):(x[I]=E.x,x[e]=E.y,x[i]=E.z))),n.bitangent&&(g&&(C[I+q]=v.x,C[e+q]=v.y,C[i+q]=v.z),y&&(f?(C[I]=B.x,C[e]=B.y,C[i]=B.z):(C[I]=v.x,C[e]=v.y,C[i]=v.z))),I+=3}}n.st&&(a.attributes.st=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:_})),n.normal&&(a.attributes.normal=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:P})),n.tangent&&(a.attributes.tangent=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x})),n.bitangent&&(a.attributes.bitangent=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C})),l&&(a.attributes.extrudeDirection=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w}))}if(o.extrude&&e.defined(o.offsetAttribute)){const e=c.length/3;let t=new Uint8Array(e);if(o.offsetAttribute===i.GeometryOffsetAttribute.TOP)y&&g||m?t=i.arrayFill(t,1,0,e/2):y&&(t=i.arrayFill(t,1));else{const e=o.offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1;t=i.arrayFill(t,e)}a.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return a}const q=new t.Cartographic,K=new t.Cartographic,Z={westOverIDL:0,eastOverIDL:0};let J=new l.EllipsoidGeodesic;function X(i,n,r,a,c){if(c=e.defaultValue(c,new t.Rectangle),!e.defined(i)||i.length<3)return c.west=0,c.north=0,c.south=0,c.east=0,c;if(r===o.ArcType.RHUMB)return t.Rectangle.fromCartesianArray(i,n,c);J.ellipsoid.equals(n)||(J=new l.EllipsoidGeodesic(void 0,void 0,n)),c.west=Number.POSITIVE_INFINITY,c.east=Number.NEGATIVE_INFINITY,c.south=Number.POSITIVE_INFINITY,c.north=Number.NEGATIVE_INFINITY,Z.westOverIDL=Number.POSITIVE_INFINITY,Z.eastOverIDL=Number.NEGATIVE_INFINITY;const u=1/s.CesiumMath.chordLength(a,n.maximumRadius),p=i.length;let m,y=n.cartesianToCartographic(i[0],K),g=q;for(let e=1;e<p;e++)m=g,g=y,y=n.cartesianToCartographic(i[e],m),J.setEndPoints(g,y),ee(J,u,c,Z);return m=g,g=y,y=n.cartesianToCartographic(i[0],m),J.setEndPoints(g,y),ee(J,u,c,Z),c.east-c.west>Z.eastOverIDL-Z.westOverIDL&&(c.west=Z.westOverIDL,c.east=Z.eastOverIDL,c.east>s.CesiumMath.PI&&(c.east=c.east-s.CesiumMath.TWO_PI),c.west>s.CesiumMath.PI&&(c.west=c.west-s.CesiumMath.TWO_PI)),c}const $=new t.Cartographic;function ee(e,t,o,i){const n=e.surfaceDistance,r=Math.ceil(n*t),a=r>0?n/(r-1):Number.POSITIVE_INFINITY;let l=0;for(let t=0;t<r;t++){const t=e.interpolateUsingSurfaceDistance(l,$);l+=a;const n=t.longitude,r=t.latitude;o.west=Math.min(o.west,n),o.east=Math.max(o.east,n),o.south=Math.min(o.south,r),o.north=Math.max(o.north,r);const c=n>=0?n:n+s.CesiumMath.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,c),i.eastOverIDL=Math.max(i.eastOverIDL,c)}}const te=[];function oe(e,t,o,i,n,r,a,s,l){const u={walls:[]};let m;if(r||a){const i=g.PolygonGeometryLibrary.createGeometryFromPositions(e,t,o,n,s,l),c=i.attributes.position.values,d=i.indices;let h,f;if(r&&a){const e=c.concat(c);h=e.length/3,f=y.IndexDatatype.createTypedArray(h,2*d.length),f.set(d);const t=d.length,o=h/2;for(m=0;m<t;m+=3){const e=f[m]+o,i=f[m+1]+o,n=f[m+2]+o;f[m+t]=n,f[m+1+t]=i,f[m+2+t]=e}if(i.attributes.position.values=e,n&&s.normal){const t=i.attributes.normal.values;i.attributes.normal.values=new Float32Array(e.length),i.attributes.normal.values.set(t)}i.indices=f}else if(a){for(h=c.length/3,f=y.IndexDatatype.createTypedArray(h,d.length),m=0;m<d.length;m+=3)f[m]=d[m+2],f[m+1]=d[m+1],f[m+2]=d[m];i.indices=f}u.topAndBottom=new p.GeometryInstance({geometry:i})}let h=i.outerRing,f=c.EllipsoidTangentPlane.fromPoints(h,e),b=f.projectPointsOntoPlane(h,te),_=d.PolygonPipeline.computeWindingOrder2D(b);_===d.WindingOrder.CLOCKWISE&&(h=h.slice().reverse());let P=g.PolygonGeometryLibrary.computeWallGeometry(h,e,o,n,l);u.walls.push(new p.GeometryInstance({geometry:P}));const x=i.holes;for(m=0;m<x.length;m++){let t=x[m];f=c.EllipsoidTangentPlane.fromPoints(t,e),b=f.projectPointsOntoPlane(t,te),_=d.PolygonPipeline.computeWindingOrder2D(b),_===d.WindingOrder.COUNTER_CLOCKWISE&&(t=t.slice().reverse()),P=g.PolygonGeometryLibrary.computeWallGeometry(t,e,o,n,l),u.walls.push(new p.GeometryInstance({geometry:P}))}return u}function ie(i){const n=i.polygonHierarchy,r=e.defaultValue(i.vertexFormat,h.VertexFormat.DEFAULT),a=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(i.granularity,s.CesiumMath.RADIANS_PER_DEGREE),c=e.defaultValue(i.stRotation,0),u=e.defaultValue(i.perPositionHeight,!1),p=u&&e.defined(i.extrudedHeight);let m=e.defaultValue(i.height,0),y=e.defaultValue(i.extrudedHeight,m);if(!p){const e=Math.max(m,y);y=Math.min(m,y),m=e}this._vertexFormat=h.VertexFormat.clone(r),this._ellipsoid=t.Ellipsoid.clone(a),this._granularity=l,this._stRotation=c,this._height=m,this._extrudedHeight=y,this._closeTop=e.defaultValue(i.closeTop,!0),this._closeBottom=e.defaultValue(i.closeBottom,!0),this._polygonHierarchy=n,this._perPositionHeight=u,this._perPositionHeightExtrude=p,this._shadowVolume=e.defaultValue(i.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=i.offsetAttribute,this._arcType=e.defaultValue(i.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=g.PolygonGeometryLibrary.computeHierarchyPackedLength(n)+t.Ellipsoid.packedLength+h.VertexFormat.packedLength+12}ie.fromPositions=function(t){return new ie({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType})},ie.pack=function(o,i,n){return n=e.defaultValue(n,0),n=g.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,i,n),t.Ellipsoid.pack(o._ellipsoid,i,n),n+=t.Ellipsoid.packedLength,h.VertexFormat.pack(o._vertexFormat,i,n),n+=h.VertexFormat.packedLength,i[n++]=o._height,i[n++]=o._extrudedHeight,i[n++]=o._granularity,i[n++]=o._stRotation,i[n++]=o._perPositionHeightExtrude?1:0,i[n++]=o._perPositionHeight?1:0,i[n++]=o._closeTop?1:0,i[n++]=o._closeBottom?1:0,i[n++]=o._shadowVolume?1:0,i[n++]=e.defaultValue(o._offsetAttribute,-1),i[n++]=o._arcType,i[n]=o.packedLength,i};const ne=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),re=new h.VertexFormat,ae={polygonHierarchy:{}};return ie.unpack=function(o,i,n){i=e.defaultValue(i,0);const r=g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,i);i=r.startingIndex,delete r.startingIndex;const a=t.Ellipsoid.unpack(o,i,ne);i+=t.Ellipsoid.packedLength;const s=h.VertexFormat.unpack(o,i,re);i+=h.VertexFormat.packedLength;const l=o[i++],c=o[i++],u=o[i++],p=o[i++],m=1===o[i++],y=1===o[i++],d=1===o[i++],f=1===o[i++],b=1===o[i++],_=o[i++],P=o[i++],x=o[i];return e.defined(n)||(n=new ie(ae)),n._polygonHierarchy=r,n._ellipsoid=t.Ellipsoid.clone(a,n._ellipsoid),n._vertexFormat=h.VertexFormat.clone(s,n._vertexFormat),n._height=l,n._extrudedHeight=c,n._granularity=u,n._stRotation=p,n._perPositionHeightExtrude=m,n._perPositionHeight=y,n._closeTop=d,n._closeBottom=f,n._shadowVolume=b,n._offsetAttribute=-1===_?void 0:_,n._arcType=P,n.packedLength=x,n},ie.computeRectangle=function(i,n){const r=e.defaultValue(i.granularity,s.CesiumMath.RADIANS_PER_DEGREE),a=e.defaultValue(i.arcType,o.ArcType.GEODESIC),l=i.polygonHierarchy,c=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84);return X(l.positions,c,a,r,n)},ie.createGeometry=function(t){const o=t._vertexFormat,n=t._ellipsoid,a=t._granularity,l=t._stRotation,h=t._polygonHierarchy,f=t._perPositionHeight,b=t._closeTop,_=t._closeBottom,P=t._arcType;let x=h.positions;if(x.length<3)return;const C=c.EllipsoidTangentPlane.fromPoints(x,n),w=g.PolygonGeometryLibrary.polygonsFromHierarchy(h,C.projectPointsOntoPlane.bind(C),!f,n),T=w.hierarchy,I=w.polygons;if(0===T.length)return;x=T[0].outerRing;const A=g.PolygonGeometryLibrary.computeBoundingRectangle(C.plane.normal,C.projectPointOntoPlane.bind(C),x,l,V),E=[],v=t._height,G=t._extrudedHeight,O={perPositionHeight:f,vertexFormat:o,geometry:void 0,tangentPlane:C,boundingRectangle:A,ellipsoid:n,stRotation:l,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:P};let F;if(t._perPositionHeightExtrude||!s.CesiumMath.equalsEpsilon(v,G,0,s.CesiumMath.EPSILON2))for(O.extrude=!0,O.top=b,O.bottom=_,O.shadowVolume=t._shadowVolume,O.offsetAttribute=t._offsetAttribute,F=0;F<I.length;F++){const e=oe(n,I[F],a,T[F],f,b,_,o,P);let t;b&&_?(t=e.topAndBottom,O.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,v,G,n,f)):b?(t=e.topAndBottom,t.geometry.attributes.position.values=d.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,v,n,!f),O.geometry=t.geometry):_&&(t=e.topAndBottom,t.geometry.attributes.position.values=d.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,G,n,!0),O.geometry=t.geometry),(b||_)&&(O.wall=!1,t.geometry=Q(O),E.push(t));const i=e.walls;O.wall=!0;for(let e=0;e<i.length;e++){const t=i[e];O.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,v,G,n,f),t.geometry=Q(O),E.push(t)}}else for(F=0;F<I.length;F++){const r=new p.GeometryInstance({geometry:g.PolygonGeometryLibrary.createGeometryFromPositions(n,I[F],a,f,o,P)});if(r.geometry.attributes.position.values=d.PolygonPipeline.scaleToGeodeticHeight(r.geometry.attributes.position.values,v,n,!f),O.geometry=r.geometry,r.geometry=Q(O),e.defined(t._offsetAttribute)){const e=r.geometry.attributes.position.values.length,o=new Uint8Array(e/3),n=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1;i.arrayFill(o,n),r.geometry.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})}E.push(r)}const D=m.GeometryPipeline.combineInstances(E)[0];D.attributes.position.values=new Float64Array(D.attributes.position.values),D.indices=y.IndexDatatype.createTypedArray(D.attributes.position.values.length/3,D.indices);const L=D.attributes,N=r.BoundingSphere.fromVertices(L.position.values);return o.position||delete L.position,new u.Geometry({attributes:L,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:N,offsetAttribute:t._offsetAttribute})},ie.createShadowVolume=function(e,t,o){const i=e._granularity,n=e._ellipsoid,r=t(i,n),a=o(i,n);return new ie({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:a,vertexFormat:h.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(ie.prototype,{rectangle:{get:function(){if(!e.defined(this._rectangle)){const e=this._polygonHierarchy.positions;this._rectangle=X(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const o=e._ellipsoid,i=e._polygonHierarchy.positions,n=e.rectangle;return u.Geometry._textureCoordinateRotationPoints(i,t,o,n)}(this)),this._textureCoordinateRotationPoints}}}),function(o,i){return e.defined(i)&&(o=ie.unpack(o,i)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),ie.createGeometry(o)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./ArcType-e1641d8d","./GeometryOffsetAttribute-4d39b441","./BoundingRectangle-13e74a41","./Transforms-fdc0a95d","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./EllipsoidGeodesic-1ab9765d","./EllipsoidTangentPlane-1cf43e5d","./GeometryAttribute-d50ea0de","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonGeometryLibrary-2a7b65e7","./PolygonPipeline-a182ab3c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./arrayRemoveDuplicates-7d5d09a3","./EllipsoidRhumbLine-001b8738","./GeometryAttributes-1b4134a9"],(function(e,t,o,r,i,n,a,s,l,u,c,d,p,y,m,g,h,f,b,_,P,C,x,w,T,I,A,v){"use strict";const E=new t.Cartographic,G=new t.Cartographic;function O(e,t,o,r){const i=r.cartesianToCartographic(e,E).height,n=r.cartesianToCartographic(t,G);n.height=i,r.cartographicToCartesian(n,t);const a=r.cartesianToCartographic(o,G);a.height=i-100,r.cartographicToCartesian(a,o)}const L=new i.BoundingRectangle,V=new t.Cartesian3,F=new t.Cartesian3,H=new t.Cartesian3,D=new t.Cartesian3,N=new t.Cartesian3,R=new t.Cartesian3;let M=new t.Cartesian3,S=new t.Cartesian3,B=new t.Cartesian3;const k=new t.Cartesian2,z=new t.Cartesian2,W=new t.Cartesian3,Y=new n.Quaternion,U=new t.Matrix3,j=new t.Matrix3;function Q(o){const i=o.vertexFormat,a=o.geometry,l=o.shadowVolume,u=a.attributes.position.values,d=e.defined(a.attributes.st)?a.attributes.st.values:void 0;let p=u.length;const y=o.wall,m=o.top||y,g=o.bottom||y;if(i.st||i.normal||i.tangent||i.bitangent||l){const r=o.boundingRectangle,h=o.tangentPlane,f=o.ellipsoid,b=o.stRotation,_=o.perPositionHeight,P=k;P.x=r.x,P.y=r.y;const C=i.st?new Float32Array(p/3*2):void 0;let x;i.normal&&(x=_&&m&&!y?a.attributes.normal.values:new Float32Array(p));const w=i.tangent?new Float32Array(p):void 0,T=i.bitangent?new Float32Array(p):void 0,I=l?new Float32Array(p):void 0;let A=0,v=0,E=F,G=H,L=D,Q=!0,q=U,K=j;if(0!==b){let e=n.Quaternion.fromAxisAngle(h._plane.normal,b,Y);q=t.Matrix3.fromQuaternion(e,q),e=n.Quaternion.fromAxisAngle(h._plane.normal,-b,Y),K=t.Matrix3.fromQuaternion(e,K)}else q=t.Matrix3.clone(t.Matrix3.IDENTITY,q),K=t.Matrix3.clone(t.Matrix3.IDENTITY,K);let Z=0,J=0;m&&g&&(Z=p/2,J=p/3,p/=2);for(let n=0;n<p;n+=3){const a=t.Cartesian3.fromArray(u,n,W);if(i.st&&!e.defined(d)){let e=t.Matrix3.multiplyByVector(q,a,V);e=f.scaleToGeodeticSurface(e,e);const o=h.projectPointOntoPlane(e,z);t.Cartesian2.subtract(o,P,o);const i=s.CesiumMath.clamp(o.x/r.width,0,1),n=s.CesiumMath.clamp(o.y/r.height,0,1);g&&(C[A+J]=i,C[A+1+J]=n),m&&(C[A]=i,C[A+1]=n),A+=2}if(i.normal||i.tangent||i.bitangent||l){const e=v+1,r=v+2;if(y){if(n+3<p){const e=t.Cartesian3.fromArray(u,n+3,N);if(Q){const o=t.Cartesian3.fromArray(u,n+p,R);_&&O(a,e,o,f),t.Cartesian3.subtract(e,a,e),t.Cartesian3.subtract(o,a,o),E=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,E),E),Q=!1}t.Cartesian3.equalsEpsilon(e,a,s.CesiumMath.EPSILON10)&&(Q=!0)}(i.tangent||i.bitangent)&&(L=f.geodeticSurfaceNormal(a,L),i.tangent&&(G=t.Cartesian3.normalize(t.Cartesian3.cross(L,E,G),G)))}else E=f.geodeticSurfaceNormal(a,E),(i.tangent||i.bitangent)&&(_&&(M=t.Cartesian3.fromArray(x,v,M),S=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,S),S=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,S,S),S),i.bitangent&&(B=t.Cartesian3.normalize(t.Cartesian3.cross(M,S,B),B))),G=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,E,G),G=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,G,G),G),i.bitangent&&(L=t.Cartesian3.normalize(t.Cartesian3.cross(E,G,L),L)));i.normal&&(o.wall?(x[v+Z]=E.x,x[e+Z]=E.y,x[r+Z]=E.z):g&&(x[v+Z]=-E.x,x[e+Z]=-E.y,x[r+Z]=-E.z),(m&&!_||y)&&(x[v]=E.x,x[e]=E.y,x[r]=E.z)),l&&(y&&(E=f.geodeticSurfaceNormal(a,E)),I[v+Z]=-E.x,I[e+Z]=-E.y,I[r+Z]=-E.z),i.tangent&&(o.wall?(w[v+Z]=G.x,w[e+Z]=G.y,w[r+Z]=G.z):g&&(w[v+Z]=-G.x,w[e+Z]=-G.y,w[r+Z]=-G.z),m&&(_?(w[v]=S.x,w[e]=S.y,w[r]=S.z):(w[v]=G.x,w[e]=G.y,w[r]=G.z))),i.bitangent&&(g&&(T[v+Z]=L.x,T[e+Z]=L.y,T[r+Z]=L.z),m&&(_?(T[v]=B.x,T[e]=B.y,T[r]=B.z):(T[v]=L.x,T[e]=L.y,T[r]=L.z))),v+=3}}i.st&&!e.defined(d)&&(a.attributes.st=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:C})),i.normal&&(a.attributes.normal=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x})),i.tangent&&(a.attributes.tangent=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),i.bitangent&&(a.attributes.bitangent=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),l&&(a.attributes.extrudeDirection=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:I}))}if(o.extrude&&e.defined(o.offsetAttribute)){const e=u.length/3;let t=new Uint8Array(e);if(o.offsetAttribute===r.GeometryOffsetAttribute.TOP)m&&g||y?t=r.arrayFill(t,1,0,e/2):m&&(t=r.arrayFill(t,1));else{const e=o.offsetAttribute===r.GeometryOffsetAttribute.NONE?0:1;t=r.arrayFill(t,e)}a.attributes.applyOffset=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return a}const q=new t.Cartographic,K=new t.Cartographic,Z={westOverIDL:0,eastOverIDL:0};let J=new l.EllipsoidGeodesic;function X(r,i,n,a,u){if(u=e.defaultValue(u,new t.Rectangle),!e.defined(r)||r.length<3)return u.west=0,u.north=0,u.south=0,u.east=0,u;if(n===o.ArcType.RHUMB)return t.Rectangle.fromCartesianArray(r,i,u);J.ellipsoid.equals(i)||(J=new l.EllipsoidGeodesic(void 0,void 0,i)),u.west=Number.POSITIVE_INFINITY,u.east=Number.NEGATIVE_INFINITY,u.south=Number.POSITIVE_INFINITY,u.north=Number.NEGATIVE_INFINITY,Z.westOverIDL=Number.POSITIVE_INFINITY,Z.eastOverIDL=Number.NEGATIVE_INFINITY;const c=1/s.CesiumMath.chordLength(a,i.maximumRadius),d=r.length;let p,y=i.cartesianToCartographic(r[0],K),m=q;for(let e=1;e<d;e++)p=m,m=y,y=i.cartesianToCartographic(r[e],p),J.setEndPoints(m,y),ee(J,c,u,Z);return p=m,m=y,y=i.cartesianToCartographic(r[0],p),J.setEndPoints(m,y),ee(J,c,u,Z),u.east-u.west>Z.eastOverIDL-Z.westOverIDL&&(u.west=Z.westOverIDL,u.east=Z.eastOverIDL,u.east>s.CesiumMath.PI&&(u.east=u.east-s.CesiumMath.TWO_PI),u.west>s.CesiumMath.PI&&(u.west=u.west-s.CesiumMath.TWO_PI)),u}const $=new t.Cartographic;function ee(e,t,o,r){const i=e.surfaceDistance,n=Math.ceil(i*t),a=n>0?i/(n-1):Number.POSITIVE_INFINITY;let l=0;for(let t=0;t<n;t++){const t=e.interpolateUsingSurfaceDistance(l,$);l+=a;const i=t.longitude,n=t.latitude;o.west=Math.min(o.west,i),o.east=Math.max(o.east,i),o.south=Math.min(o.south,n),o.north=Math.max(o.north,n);const u=i>=0?i:i+s.CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,u),r.eastOverIDL=Math.max(r.eastOverIDL,u)}}const te=[];function oe(t,o,r,i,n,a,s,l,c,p){const h={walls:[]};let f;if(s||l){const n=m.PolygonGeometryLibrary.createGeometryFromPositions(t,o,r,i,a,c,p),u=n.attributes.position.values,g=n.indices;let b,_;if(s&&l){const t=u.concat(u);b=t.length/3,_=y.IndexDatatype.createTypedArray(b,2*g.length),_.set(g);const o=g.length,i=b/2;for(f=0;f<o;f+=3){const e=_[f]+i,t=_[f+1]+i,r=_[f+2]+i;_[f+o]=r,_[f+1+o]=t,_[f+2+o]=e}if(n.attributes.position.values=t,a&&c.normal){const e=n.attributes.normal.values;n.attributes.normal.values=new Float32Array(t.length),n.attributes.normal.values.set(e)}if(c.st&&e.defined(r)){const e=n.attributes.st.values;n.attributes.st.values=new Float32Array(2*b),n.attributes.st.values=e.concat(e)}n.indices=_}else if(l){for(b=u.length/3,_=y.IndexDatatype.createTypedArray(b,g.length),f=0;f<g.length;f+=3)_[f]=g[f+2],_[f+1]=g[f+1],_[f+2]=g[f];n.indices=_}h.topAndBottom=new d.GeometryInstance({geometry:n})}let b=n.outerRing,_=u.EllipsoidTangentPlane.fromPoints(b,t),P=_.projectPointsOntoPlane(b,te),C=g.PolygonPipeline.computeWindingOrder2D(P);C===g.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());let x=m.PolygonGeometryLibrary.computeWallGeometry(b,r,t,i,a,p);h.walls.push(new d.GeometryInstance({geometry:x}));const w=n.holes;for(f=0;f<w.length;f++){let e=w[f];_=u.EllipsoidTangentPlane.fromPoints(e,t),P=_.projectPointsOntoPlane(e,te),C=g.PolygonPipeline.computeWindingOrder2D(P),C===g.WindingOrder.COUNTER_CLOCKWISE&&(e=e.slice().reverse()),x=m.PolygonGeometryLibrary.computeWallGeometry(e,r,t,i,a,p),h.walls.push(new d.GeometryInstance({geometry:x}))}return h}function re(r){const i=r.polygonHierarchy,n=e.defaultValue(r.vertexFormat,h.VertexFormat.DEFAULT),a=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(r.granularity,s.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(r.stRotation,0),c=r.textureCoordinates,d=e.defaultValue(r.perPositionHeight,!1),p=d&&e.defined(r.extrudedHeight);let y=e.defaultValue(r.height,0),g=e.defaultValue(r.extrudedHeight,y);if(!p){const e=Math.max(y,g);g=Math.min(y,g),y=e}this._vertexFormat=h.VertexFormat.clone(n),this._ellipsoid=t.Ellipsoid.clone(a),this._granularity=l,this._stRotation=u,this._height=y,this._extrudedHeight=g,this._closeTop=e.defaultValue(r.closeTop,!0),this._closeBottom=e.defaultValue(r.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=d,this._perPositionHeightExtrude=p,this._shadowVolume=e.defaultValue(r.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=r.offsetAttribute,this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=c,this.packedLength=m.PolygonGeometryLibrary.computeHierarchyPackedLength(i,t.Cartesian3)+t.Ellipsoid.packedLength+h.VertexFormat.packedLength+(c?m.PolygonGeometryLibrary.computeHierarchyPackedLength(c,t.Cartesian2):1)+12}re.fromPositions=function(t){return new re({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates})},re.pack=function(o,r,i){return i=e.defaultValue(i,0),i=m.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,r,i,t.Cartesian3),t.Ellipsoid.pack(o._ellipsoid,r,i),i+=t.Ellipsoid.packedLength,h.VertexFormat.pack(o._vertexFormat,r,i),i+=h.VertexFormat.packedLength,r[i++]=o._height,r[i++]=o._extrudedHeight,r[i++]=o._granularity,r[i++]=o._stRotation,r[i++]=o._perPositionHeightExtrude?1:0,r[i++]=o._perPositionHeight?1:0,r[i++]=o._closeTop?1:0,r[i++]=o._closeBottom?1:0,r[i++]=o._shadowVolume?1:0,r[i++]=e.defaultValue(o._offsetAttribute,-1),r[i++]=o._arcType,e.defined(o._textureCoordinates)?i=m.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,r,i,t.Cartesian2):r[i++]=-1,r[i++]=o.packedLength,r};const ie=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),ne=new h.VertexFormat,ae={polygonHierarchy:{}};return re.unpack=function(o,r,i){r=e.defaultValue(r,0);const n=m.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian3);r=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(o,r,ie);r+=t.Ellipsoid.packedLength;const s=h.VertexFormat.unpack(o,r,ne);r+=h.VertexFormat.packedLength;const l=o[r++],u=o[r++],c=o[r++],d=o[r++],p=1===o[r++],y=1===o[r++],g=1===o[r++],f=1===o[r++],b=1===o[r++],_=o[r++],P=o[r++],C=-1===o[r]?void 0:m.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian2);e.defined(C)?(r=C.startingIndex,delete C.startingIndex):r++;const x=o[r++];return e.defined(i)||(i=new re(ae)),i._polygonHierarchy=n,i._ellipsoid=t.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=h.VertexFormat.clone(s,i._vertexFormat),i._height=l,i._extrudedHeight=u,i._granularity=c,i._stRotation=d,i._perPositionHeightExtrude=p,i._perPositionHeight=y,i._closeTop=g,i._closeBottom=f,i._shadowVolume=b,i._offsetAttribute=-1===_?void 0:_,i._arcType=P,i._textureCoordinates=C,i.packedLength=x,i},re.computeRectangle=function(r,i){const n=e.defaultValue(r.granularity,s.CesiumMath.RADIANS_PER_DEGREE),a=e.defaultValue(r.arcType,o.ArcType.GEODESIC),l=r.polygonHierarchy,u=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84);return X(l.positions,u,a,n,i)},re.createGeometry=function(t){const o=t._vertexFormat,i=t._ellipsoid,a=t._granularity,l=t._stRotation,h=t._polygonHierarchy,f=t._perPositionHeight,b=t._closeTop,_=t._closeBottom,P=t._arcType,C=t._textureCoordinates,x=e.defined(C);let w=h.positions;if(w.length<3)return;const T=u.EllipsoidTangentPlane.fromPoints(w,i),I=m.PolygonGeometryLibrary.polygonsFromHierarchy(h,x,T.projectPointsOntoPlane.bind(T),!f,i),A=I.hierarchy,v=I.polygons,E=x?m.PolygonGeometryLibrary.polygonsFromHierarchy(C,!0,(function(e){return e}),!1).polygons:void 0;if(0===A.length)return;w=A[0].outerRing;const G=m.PolygonGeometryLibrary.computeBoundingRectangle(T.plane.normal,T.projectPointOntoPlane.bind(T),w,l,L),O=[],V=t._height,F=t._extrudedHeight,H={perPositionHeight:f,vertexFormat:o,geometry:void 0,tangentPlane:T,boundingRectangle:G,ellipsoid:i,stRotation:l,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:P};let D;if(t._perPositionHeightExtrude||!s.CesiumMath.equalsEpsilon(V,F,0,s.CesiumMath.EPSILON2))for(H.extrude=!0,H.top=b,H.bottom=_,H.shadowVolume=t._shadowVolume,H.offsetAttribute=t._offsetAttribute,D=0;D<v.length;D++){const e=oe(i,v[D],x?E[D]:void 0,a,A[D],f,b,_,o,P);let t;b&&_?(t=e.topAndBottom,H.geometry=m.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,F,i,f)):b?(t=e.topAndBottom,t.geometry.attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,V,i,!f),H.geometry=t.geometry):_&&(t=e.topAndBottom,t.geometry.attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,F,i,!0),H.geometry=t.geometry),(b||_)&&(H.wall=!1,t.geometry=Q(H),O.push(t));const r=e.walls;H.wall=!0;for(let e=0;e<r.length;e++){const t=r[e];H.geometry=m.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,F,i,f),t.geometry=Q(H),O.push(t)}}else for(D=0;D<v.length;D++){const n=new d.GeometryInstance({geometry:m.PolygonGeometryLibrary.createGeometryFromPositions(i,v[D],x?E[D]:void 0,a,f,o,P)});if(n.geometry.attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(n.geometry.attributes.position.values,V,i,!f),H.geometry=n.geometry,n.geometry=Q(H),e.defined(t._offsetAttribute)){const e=n.geometry.attributes.position.values.length,o=new Uint8Array(e/3),i=t._offsetAttribute===r.GeometryOffsetAttribute.NONE?0:1;r.arrayFill(o,i),n.geometry.attributes.applyOffset=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})}O.push(n)}const N=p.GeometryPipeline.combineInstances(O)[0];N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=y.IndexDatatype.createTypedArray(N.attributes.position.values.length/3,N.indices);const R=N.attributes,M=n.BoundingSphere.fromVertices(R.position.values);return o.position||delete R.position,new c.Geometry({attributes:R,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:M,offsetAttribute:t._offsetAttribute})},re.createShadowVolume=function(e,t,o){const r=e._granularity,i=e._ellipsoid,n=t(r,i),a=o(r,i);return new re({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:h.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(re.prototype,{rectangle:{get:function(){if(!e.defined(this._rectangle)){const e=this._polygonHierarchy.positions;this._rectangle=X(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const o=e._ellipsoid,r=e._polygonHierarchy.positions,i=e.rectangle;return c.Geometry._textureCoordinateRotationPoints(r,t,o,i)}(this)),this._textureCoordinateRotationPoints}}}),function(o,r){return e.defined(r)&&(o=re.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),re.createGeometry(o)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./ArcType-e1641d8d","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./EllipsoidTangentPlane-01395a15","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonGeometryLibrary-a64b67ab","./PolygonPipeline-1015dc5c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./arrayRemoveDuplicates-fe254feb","./EllipsoidRhumbLine-94e77fa4"],(function(e,t,i,o,r,n,a,l,s,y,u,p,d,c,f,g,m,h,b,P,E,A,_,G,L){"use strict";const H=[],T=[];function v(e,t,o,r,n){const p=l.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(p)===f.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length,b=0;if(r)for(g=new Float64Array(2*h*3),m=0;m<h;m++){const e=t[m],i=t[(m+1)%h];g[b++]=e.x,g[b++]=e.y,g[b++]=e.z,g[b++]=i.x,g[b++]=i.y,g[b++]=i.z}else{let r=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],o);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],o);for(g=new Float64Array(3*r),m=0;m<h;m++){let r;n===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],o,T):n===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],o,T));const a=r.length;for(let e=0;e<a;++e)g[b++]=r[e]}}h=g.length/3;const P=2*h,E=d.IndexDatatype.createTypedArray(h,P);for(b=0,m=0;m<h-1;m++)E[b++]=m,E[b++]=m+1;return E[b++]=h-1,E[b++]=0,new u.GeometryInstance({geometry:new s.Geometry({attributes:new y.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:E,primitiveType:s.PrimitiveType.LINES})})}function O(e,t,o,r,n){const p=l.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(p)===f.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length;const b=new Array(h);let P=0;if(r)for(g=new Float64Array(2*h*3*2),m=0;m<h;++m){b[m]=P/3;const e=t[m],i=t[(m+1)%h];g[P++]=e.x,g[P++]=e.y,g[P++]=e.z,g[P++]=i.x,g[P++]=i.y,g[P++]=i.z}else{let r=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)r+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],o);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)r+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],o);for(g=new Float64Array(3*r*2),m=0;m<h;++m){let r;b[m]=P/3,n===i.ArcType.GEODESIC?r=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],o,T):n===i.ArcType.RHUMB&&(r=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],o,T));const a=r.length;for(let e=0;e<a;++e)g[P++]=r[e]}}h=g.length/6;const E=b.length,A=2*(2*h+E),_=d.IndexDatatype.createTypedArray(h+E,A);for(P=0,m=0;m<h;++m)_[P++]=m,_[P++]=(m+1)%h,_[P++]=m+h,_[P++]=(m+1)%h+h;for(m=0;m<E;m++){const e=b[m];_[P++]=e,_[P++]=e+h}return new u.GeometryInstance({geometry:new s.Geometry({attributes:new y.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:_,primitiveType:s.PrimitiveType.LINES})})}function x(o){const r=o.polygonHierarchy,n=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(o.granularity,a.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(o.perPositionHeight,!1),y=s&&e.defined(o.extrudedHeight),u=e.defaultValue(o.arcType,i.ArcType.GEODESIC);let p=e.defaultValue(o.height,0),d=e.defaultValue(o.extrudedHeight,p);if(!y){const e=Math.max(p,d);d=Math.min(p,d),p=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=l,this._height=p,this._extrudedHeight=d,this._arcType=u,this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=y,this._offsetAttribute=o.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=c.PolygonGeometryLibrary.computeHierarchyPackedLength(r)+t.Ellipsoid.packedLength+8}x.pack=function(i,o,r){return r=e.defaultValue(r,0),r=c.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,o,r),t.Ellipsoid.pack(i._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=i._height,o[r++]=i._extrudedHeight,o[r++]=i._granularity,o[r++]=i._perPositionHeightExtrude?1:0,o[r++]=i._perPositionHeight?1:0,o[r++]=i._arcType,o[r++]=e.defaultValue(i._offsetAttribute,-1),o[r]=i.packedLength,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D={polygonHierarchy:{}};return x.unpack=function(i,o,r){o=e.defaultValue(o,0);const n=c.PolygonGeometryLibrary.unpackPolygonHierarchy(i,o);o=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(i,o,C);o+=t.Ellipsoid.packedLength;const l=i[o++],s=i[o++],y=i[o++],u=1===i[o++],p=1===i[o++],d=i[o++],f=i[o++],g=i[o];return e.defined(r)||(r=new x(D)),r._polygonHierarchy=n,r._ellipsoid=t.Ellipsoid.clone(a,r._ellipsoid),r._height=l,r._extrudedHeight=s,r._granularity=y,r._perPositionHeight=p,r._perPositionHeightExtrude=u,r._arcType=d,r._offsetAttribute=-1===f?void 0:f,r.packedLength=g,r},x.fromPositions=function(t){return new x({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute})},x.createGeometry=function(t){const i=t._ellipsoid,n=t._granularity,l=t._polygonHierarchy,y=t._perPositionHeight,u=t._arcType,d=c.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(l,!y,i);if(0===d.length)return;let g;const m=[],h=a.CesiumMath.chordLength(n,i.maximumRadius),b=t._height,P=t._extrudedHeight;let E,A;if(t._perPositionHeightExtrude||!a.CesiumMath.equalsEpsilon(b,P,0,a.CesiumMath.EPSILON2))for(A=0;A<d.length;A++){if(g=O(i,d[A],h,y,u),g.geometry=c.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(g.geometry,b,P,i,y),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===o.GeometryOffsetAttribute.TOP?i=o.arrayFill(i,1,0,e/2):(E=t._offsetAttribute===o.GeometryOffsetAttribute.NONE?0:1,i=o.arrayFill(i,E)),g.geometry.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(g)}else for(A=0;A<d.length;A++){if(g=v(i,d[A],h,y,u),g.geometry.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(g.geometry.attributes.position.values,b,i,!y),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length,i=new Uint8Array(e/3);E=t._offsetAttribute===o.GeometryOffsetAttribute.NONE?0:1,o.arrayFill(i,E),g.geometry.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(g)}const _=p.GeometryPipeline.combineInstances(m)[0],G=r.BoundingSphere.fromVertices(_.attributes.position.values);return new s.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:G,offsetAttribute:t._offsetAttribute})},function(i,o){return e.defined(o)&&(i=x.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),x.createGeometry(i)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./ArcType-e1641d8d","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./EllipsoidTangentPlane-1cf43e5d","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonGeometryLibrary-2a7b65e7","./PolygonPipeline-a182ab3c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./arrayRemoveDuplicates-7d5d09a3","./EllipsoidRhumbLine-001b8738"],(function(e,t,i,r,o,n,a,s,l,y,u,p,d,c,f,g,m,h,b,P,E,A,_,G,L){"use strict";const H=[],T=[];function v(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(p)===f.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length,b=0;if(o)for(g=new Float64Array(2*h*3),m=0;m<h;m++){const e=t[m],i=t[(m+1)%h];g[b++]=e.x,g[b++]=e.y,g[b++]=e.z,g[b++]=i.x,g[b++]=i.y,g[b++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(g=new Float64Array(3*o),m=0;m<h;m++){let o;n===i.ArcType.GEODESIC?o=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,T):n===i.ArcType.RHUMB&&(o=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,T));const a=o.length;for(let e=0;e<a;++e)g[b++]=o[e]}}h=g.length/3;const P=2*h,E=d.IndexDatatype.createTypedArray(h,P);for(b=0,m=0;m<h-1;m++)E[b++]=m,E[b++]=m+1;return E[b++]=h-1,E[b++]=0,new u.GeometryInstance({geometry:new l.Geometry({attributes:new y.GeometryAttributes({position:new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:E,primitiveType:l.PrimitiveType.LINES})})}function C(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(p)===f.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length;const b=new Array(h);let P=0;if(o)for(g=new Float64Array(2*h*3*2),m=0;m<h;++m){b[m]=P/3;const e=t[m],i=t[(m+1)%h];g[P++]=e.x,g[P++]=e.y,g[P++]=e.z,g[P++]=i.x,g[P++]=i.y,g[P++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(g=new Float64Array(3*o*2),m=0;m<h;++m){let o;b[m]=P/3,n===i.ArcType.GEODESIC?o=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,T):n===i.ArcType.RHUMB&&(o=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,T));const a=o.length;for(let e=0;e<a;++e)g[P++]=o[e]}}h=g.length/6;const E=b.length,A=2*(2*h+E),_=d.IndexDatatype.createTypedArray(h+E,A);for(P=0,m=0;m<h;++m)_[P++]=m,_[P++]=(m+1)%h,_[P++]=m+h,_[P++]=(m+1)%h+h;for(m=0;m<E;m++){const e=b[m];_[P++]=e,_[P++]=e+h}return new u.GeometryInstance({geometry:new l.Geometry({attributes:new y.GeometryAttributes({position:new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:_,primitiveType:l.PrimitiveType.LINES})})}function O(r){const o=r.polygonHierarchy,n=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),s=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(r.perPositionHeight,!1),y=l&&e.defined(r.extrudedHeight),u=e.defaultValue(r.arcType,i.ArcType.GEODESIC);let p=e.defaultValue(r.height,0),d=e.defaultValue(r.extrudedHeight,p);if(!y){const e=Math.max(p,d);d=Math.min(p,d),p=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=s,this._height=p,this._extrudedHeight=d,this._arcType=u,this._polygonHierarchy=o,this._perPositionHeight=l,this._perPositionHeightExtrude=y,this._offsetAttribute=r.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=c.PolygonGeometryLibrary.computeHierarchyPackedLength(o,t.Cartesian3)+t.Ellipsoid.packedLength+8}O.pack=function(i,r,o){return o=e.defaultValue(o,0),o=c.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,r,o,t.Cartesian3),t.Ellipsoid.pack(i._ellipsoid,r,o),o+=t.Ellipsoid.packedLength,r[o++]=i._height,r[o++]=i._extrudedHeight,r[o++]=i._granularity,r[o++]=i._perPositionHeightExtrude?1:0,r[o++]=i._perPositionHeight?1:0,r[o++]=i._arcType,r[o++]=e.defaultValue(i._offsetAttribute,-1),r[o]=i.packedLength,r};const x=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D={polygonHierarchy:{}};return O.unpack=function(i,r,o){r=e.defaultValue(r,0);const n=c.PolygonGeometryLibrary.unpackPolygonHierarchy(i,r,t.Cartesian3);r=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(i,r,x);r+=t.Ellipsoid.packedLength;const s=i[r++],l=i[r++],y=i[r++],u=1===i[r++],p=1===i[r++],d=i[r++],f=i[r++],g=i[r];return e.defined(o)||(o=new O(D)),o._polygonHierarchy=n,o._ellipsoid=t.Ellipsoid.clone(a,o._ellipsoid),o._height=s,o._extrudedHeight=l,o._granularity=y,o._perPositionHeight=p,o._perPositionHeightExtrude=u,o._arcType=d,o._offsetAttribute=-1===f?void 0:f,o.packedLength=g,o},O.fromPositions=function(t){return new O({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute})},O.createGeometry=function(t){const i=t._ellipsoid,n=t._granularity,s=t._polygonHierarchy,y=t._perPositionHeight,u=t._arcType,d=c.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(s,!y,i);if(0===d.length)return;let g;const m=[],h=a.CesiumMath.chordLength(n,i.maximumRadius),b=t._height,P=t._extrudedHeight;let E,A;if(t._perPositionHeightExtrude||!a.CesiumMath.equalsEpsilon(b,P,0,a.CesiumMath.EPSILON2))for(A=0;A<d.length;A++){if(g=C(i,d[A],h,y,u),g.geometry=c.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(g.geometry,b,P,i,y),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length/3;let i=new Uint8Array(e);t._offsetAttribute===r.GeometryOffsetAttribute.TOP?i=r.arrayFill(i,1,0,e/2):(E=t._offsetAttribute===r.GeometryOffsetAttribute.NONE?0:1,i=r.arrayFill(i,E)),g.geometry.attributes.applyOffset=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(g)}else for(A=0;A<d.length;A++){if(g=v(i,d[A],h,y,u),g.geometry.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(g.geometry.attributes.position.values,b,i,!y),e.defined(t._offsetAttribute)){const e=g.geometry.attributes.position.values.length,i=new Uint8Array(e/3);E=t._offsetAttribute===r.GeometryOffsetAttribute.NONE?0:1,r.arrayFill(i,E),g.geometry.attributes.applyOffset=new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}m.push(g)}const _=p.GeometryPipeline.combineInstances(m)[0],G=o.BoundingSphere.fromVertices(_.attributes.position.values);return new l.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:G,offsetAttribute:t._offsetAttribute})},function(i,r){return e.defined(r)&&(i=O.unpack(i,r)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),O.createGeometry(i)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./ArcType-e1641d8d","./arrayRemoveDuplicates-fe254feb","./Transforms-06c05e21","./Color-451a8720","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolylinePipeline-256ec228","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,o,n,r,a,i,l,s,c,p,d,u,y,m,f,h,C,g,_){"use strict";const A=[];function E(e,t,o,n,r){const i=A;let l;i.length=r;const s=o.red,c=o.green,p=o.blue,d=o.alpha,u=n.red,y=n.green,m=n.blue,f=n.alpha;if(a.Color.equals(o,n)){for(l=0;l<r;l++)i[l]=a.Color.clone(o);return i}const h=(u-s)/r,C=(y-c)/r,g=(m-p)/r,_=(f-d)/r;for(l=0;l<r;l++)i[l]=new a.Color(s+l*h,c+l*C,p+l*g,d+l*_);return i}function P(n){const r=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,l=n.colors,s=e.defaultValue(n.width,1),c=e.defaultValue(n.colorsPerVertex,!1);this._positions=r,this._colors=l,this._width=s,this._colorsPerVertex=c,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(n.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(n.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(n.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";let p=1+r.length*t.Cartesian3.packedLength;p+=e.defined(l)?1+l.length*a.Color.packedLength:1,this.packedLength=p+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}P.pack=function(o,n,r){let i;r=e.defaultValue(r,0);const l=o._positions;let s=l.length;for(n[r++]=s,i=0;i<s;++i,r+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[i],n,r);const c=o._colors;for(s=e.defined(c)?c.length:0,n[r++]=s,i=0;i<s;++i,r+=a.Color.packedLength)a.Color.pack(c[i],n,r);return t.Ellipsoid.pack(o._ellipsoid,n,r),r+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,n,r),r+=u.VertexFormat.packedLength,n[r++]=o._width,n[r++]=o._colorsPerVertex?1:0,n[r++]=o._arcType,n[r]=o._granularity,n};const b=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),w=new u.VertexFormat,x={positions:void 0,colors:void 0,ellipsoid:b,vertexFormat:w,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};P.unpack=function(o,n,r){let i;n=e.defaultValue(n,0);let l=o[n++];const s=new Array(l);for(i=0;i<l;++i,n+=t.Cartesian3.packedLength)s[i]=t.Cartesian3.unpack(o,n);l=o[n++];const c=l>0?new Array(l):void 0;for(i=0;i<l;++i,n+=a.Color.packedLength)c[i]=a.Color.unpack(o,n);const p=t.Ellipsoid.unpack(o,n,b);n+=t.Ellipsoid.packedLength;const d=u.VertexFormat.unpack(o,n,w);n+=u.VertexFormat.packedLength;const y=o[n++],m=1===o[n++],f=o[n++],h=o[n];return e.defined(r)?(r._positions=s,r._colors=c,r._ellipsoid=t.Ellipsoid.clone(p,r._ellipsoid),r._vertexFormat=u.VertexFormat.clone(d,r._vertexFormat),r._width=y,r._colorsPerVertex=m,r._arcType=f,r._granularity=h,r):(x.positions=s,x.colors=c,x.width=y,x.colorsPerVertex=m,x.arcType=f,x.granularity=h,new P(x))};const T=new t.Cartesian3,D=new t.Cartesian3,k=new t.Cartesian3,V=new t.Cartesian3;return P.createGeometry=function(l){const u=l._width,y=l._vertexFormat;let m=l._colors;const f=l._colorsPerVertex,h=l._arcType,C=l._granularity,g=l._ellipsoid;let _,P,b;const w=[];let x=n.arrayRemoveDuplicates(l._positions,t.Cartesian3.equalsEpsilon,!1,w);if(e.defined(m)&&w.length>0){let e=0,t=w[0];m=m.filter((function(o,n){let r=!1;return r=f?n===t||0===n&&1===t:n+1===t,!r||(e++,t=w[e],!1)}))}let v=x.length;if(v<2||u<=0)return;if(h===o.ArcType.GEODESIC||h===o.ArcType.RHUMB){let t,n;h===o.ArcType.GEODESIC?(t=i.CesiumMath.chordLength(C,g.maximumRadius),n=d.PolylinePipeline.numberOfPoints):(t=C,n=d.PolylinePipeline.numberOfPointsRhumbLine);const r=d.PolylinePipeline.extractHeights(x,g);if(e.defined(m)){let e=1;for(_=0;_<v-1;++_)e+=n(x[_],x[_+1],t);const o=new Array(e);let r=0;for(_=0;_<v-1;++_){const i=x[_],l=x[_+1],s=m[_],c=n(i,l,t);if(f&&_<e){const e=E(0,0,s,m[_+1],c),t=e.length;for(P=0;P<t;++P)o[r++]=e[P]}else for(P=0;P<c;++P)o[r++]=a.Color.clone(s)}o[r]=a.Color.clone(m[m.length-1]),m=o,A.length=0}x=h===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:x,minDistance:t,ellipsoid:g,height:r}):d.PolylinePipeline.generateCartesianRhumbArc({positions:x,granularity:t,ellipsoid:g,height:r})}v=x.length;const L=4*v-4,F=new Float64Array(3*L),G=new Float64Array(3*L),O=new Float64Array(3*L),R=new Float32Array(2*L),I=y.st?new Float32Array(2*L):void 0,S=e.defined(m)?new Uint8Array(4*L):void 0;let B,U=0,N=0,M=0,H=0;for(P=0;P<v;++P){let o,n;0===P?(B=T,t.Cartesian3.subtract(x[0],x[1],B),t.Cartesian3.add(x[0],B,B)):B=x[P-1],t.Cartesian3.clone(B,k),t.Cartesian3.clone(x[P],D),P===v-1?(B=T,t.Cartesian3.subtract(x[v-1],x[v-2],B),t.Cartesian3.add(x[v-1],B,B)):B=x[P+1],t.Cartesian3.clone(B,V),e.defined(S)&&(o=0===P||f?m[P]:m[P-1],P!==v-1&&(n=m[P]));const r=P===v-1?2:4;for(b=0===P?2:0;b<r;++b){t.Cartesian3.pack(D,F,U),t.Cartesian3.pack(k,G,U),t.Cartesian3.pack(V,O,U),U+=3;const r=b-2<0?-1:1;if(R[N++]=b%2*2-1,R[N++]=r*u,y.st&&(I[M++]=P/(v-1),I[M++]=Math.max(R[N-2],0)),e.defined(S)){const e=b<2?o:n;S[H++]=a.Color.floatToByte(e.red),S[H++]=a.Color.floatToByte(e.green),S[H++]=a.Color.floatToByte(e.blue),S[H++]=a.Color.floatToByte(e.alpha)}}}const W=new c.GeometryAttributes;W.position=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F}),W.prevPosition=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),W.nextPosition=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),W.expandAndWidth=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:R}),y.st&&(W.st=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I})),e.defined(S)&&(W.color=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));const Y=p.IndexDatatype.createTypedArray(L,6*v-6);let q=0,j=0;const z=v-1;for(P=0;P<z;++P)Y[j++]=q,Y[j++]=q+2,Y[j++]=q+1,Y[j++]=q+1,Y[j++]=q+2,Y[j++]=q+3,q+=4;return new s.Geometry({attributes:W,indices:Y,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:r.BoundingSphere.fromPoints(x),geometryType:s.GeometryType.POLYLINES})},function(o,n){return e.defined(n)&&(o=P.unpack(o,n)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),P.createGeometry(o)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./ArcType-e1641d8d","./arrayRemoveDuplicates-7d5d09a3","./Transforms-fdc0a95d","./Color-12d5ab6e","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolylinePipeline-4f5c4291","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,o,n,r,a,i,l,s,c,p,d,u,y,m,f,h,C,g,_){"use strict";const A=[];function E(e,t,o,n,r){const i=A;let l;i.length=r;const s=o.red,c=o.green,p=o.blue,d=o.alpha,u=n.red,y=n.green,m=n.blue,f=n.alpha;if(a.Color.equals(o,n)){for(l=0;l<r;l++)i[l]=a.Color.clone(o);return i}const h=(u-s)/r,C=(y-c)/r,g=(m-p)/r,_=(f-d)/r;for(l=0;l<r;l++)i[l]=new a.Color(s+l*h,c+l*C,p+l*g,d+l*_);return i}function b(n){const r=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,l=n.colors,s=e.defaultValue(n.width,1),c=e.defaultValue(n.colorsPerVertex,!1);this._positions=r,this._colors=l,this._width=s,this._colorsPerVertex=c,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(n.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(n.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(n.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";let p=1+r.length*t.Cartesian3.packedLength;p+=e.defined(l)?1+l.length*a.Color.packedLength:1,this.packedLength=p+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}b.pack=function(o,n,r){let i;r=e.defaultValue(r,0);const l=o._positions;let s=l.length;for(n[r++]=s,i=0;i<s;++i,r+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[i],n,r);const c=o._colors;for(s=e.defined(c)?c.length:0,n[r++]=s,i=0;i<s;++i,r+=a.Color.packedLength)a.Color.pack(c[i],n,r);return t.Ellipsoid.pack(o._ellipsoid,n,r),r+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,n,r),r+=u.VertexFormat.packedLength,n[r++]=o._width,n[r++]=o._colorsPerVertex?1:0,n[r++]=o._arcType,n[r]=o._granularity,n};const P=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),w=new u.VertexFormat,x={positions:void 0,colors:void 0,ellipsoid:P,vertexFormat:w,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};b.unpack=function(o,n,r){let i;n=e.defaultValue(n,0);let l=o[n++];const s=new Array(l);for(i=0;i<l;++i,n+=t.Cartesian3.packedLength)s[i]=t.Cartesian3.unpack(o,n);l=o[n++];const c=l>0?new Array(l):void 0;for(i=0;i<l;++i,n+=a.Color.packedLength)c[i]=a.Color.unpack(o,n);const p=t.Ellipsoid.unpack(o,n,P);n+=t.Ellipsoid.packedLength;const d=u.VertexFormat.unpack(o,n,w);n+=u.VertexFormat.packedLength;const y=o[n++],m=1===o[n++],f=o[n++],h=o[n];return e.defined(r)?(r._positions=s,r._colors=c,r._ellipsoid=t.Ellipsoid.clone(p,r._ellipsoid),r._vertexFormat=u.VertexFormat.clone(d,r._vertexFormat),r._width=y,r._colorsPerVertex=m,r._arcType=f,r._granularity=h,r):(x.positions=s,x.colors=c,x.width=y,x.colorsPerVertex=m,x.arcType=f,x.granularity=h,new b(x))};const T=new t.Cartesian3,D=new t.Cartesian3,k=new t.Cartesian3,V=new t.Cartesian3;return b.createGeometry=function(l){const u=l._width,y=l._vertexFormat;let m=l._colors;const f=l._colorsPerVertex,h=l._arcType,C=l._granularity,g=l._ellipsoid;let _,b,P;const w=[];let x=n.arrayRemoveDuplicates(l._positions,t.Cartesian3.equalsEpsilon,!1,w);if(e.defined(m)&&w.length>0){let e=0,t=w[0];m=m.filter((function(o,n){let r=!1;return r=f?n===t||0===n&&1===t:n+1===t,!r||(e++,t=w[e],!1)}))}let v=x.length;if(v<2||u<=0)return;if(h===o.ArcType.GEODESIC||h===o.ArcType.RHUMB){let t,n;h===o.ArcType.GEODESIC?(t=i.CesiumMath.chordLength(C,g.maximumRadius),n=d.PolylinePipeline.numberOfPoints):(t=C,n=d.PolylinePipeline.numberOfPointsRhumbLine);const r=d.PolylinePipeline.extractHeights(x,g);if(e.defined(m)){let e=1;for(_=0;_<v-1;++_)e+=n(x[_],x[_+1],t);const o=new Array(e);let r=0;for(_=0;_<v-1;++_){const i=x[_],l=x[_+1],s=m[_],c=n(i,l,t);if(f&&_<e){const e=E(0,0,s,m[_+1],c),t=e.length;for(b=0;b<t;++b)o[r++]=e[b]}else for(b=0;b<c;++b)o[r++]=a.Color.clone(s)}o[r]=a.Color.clone(m[m.length-1]),m=o,A.length=0}x=h===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:x,minDistance:t,ellipsoid:g,height:r}):d.PolylinePipeline.generateCartesianRhumbArc({positions:x,granularity:t,ellipsoid:g,height:r})}v=x.length;const L=4*v-4,F=new Float64Array(3*L),G=new Float64Array(3*L),O=new Float64Array(3*L),R=new Float32Array(2*L),I=y.st?new Float32Array(2*L):void 0,S=e.defined(m)?new Uint8Array(4*L):void 0;let B,U=0,N=0,M=0,H=0;for(b=0;b<v;++b){let o,n;0===b?(B=T,t.Cartesian3.subtract(x[0],x[1],B),t.Cartesian3.add(x[0],B,B)):B=x[b-1],t.Cartesian3.clone(B,k),t.Cartesian3.clone(x[b],D),b===v-1?(B=T,t.Cartesian3.subtract(x[v-1],x[v-2],B),t.Cartesian3.add(x[v-1],B,B)):B=x[b+1],t.Cartesian3.clone(B,V),e.defined(S)&&(o=0===b||f?m[b]:m[b-1],b!==v-1&&(n=m[b]));const r=b===v-1?2:4;for(P=0===b?2:0;P<r;++P){t.Cartesian3.pack(D,F,U),t.Cartesian3.pack(k,G,U),t.Cartesian3.pack(V,O,U),U+=3;const r=P-2<0?-1:1;if(R[N++]=P%2*2-1,R[N++]=r*u,y.st&&(I[M++]=b/(v-1),I[M++]=Math.max(R[N-2],0)),e.defined(S)){const e=P<2?o:n;S[H++]=a.Color.floatToByte(e.red),S[H++]=a.Color.floatToByte(e.green),S[H++]=a.Color.floatToByte(e.blue),S[H++]=a.Color.floatToByte(e.alpha)}}}const W=new c.GeometryAttributes;W.position=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F}),W.prevPosition=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),W.nextPosition=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),W.expandAndWidth=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:R}),y.st&&(W.st=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I})),e.defined(S)&&(W.color=new s.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));const Y=p.IndexDatatype.createTypedArray(L,6*v-6);let q=0,j=0;const z=v-1;for(b=0;b<z;++b)Y[j++]=q,Y[j++]=q+2,Y[j++]=q+1,Y[j++]=q+1,Y[j++]=q+2,Y[j++]=q+3,q+=4;return new s.Geometry({attributes:W,indices:Y,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:r.BoundingSphere.fromPoints(x),geometryType:s.GeometryType.POLYLINES})},function(o,n){return e.defined(n)&&(o=b.unpack(o,n)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),b.createGeometry(o)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./arrayRemoveDuplicates-fe254feb","./BoundingRectangle-00ff5b29","./Transforms-06c05e21","./ComponentDatatype-a9820060","./PolylineVolumeGeometryLibrary-c9777b58","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5"],(function(e,t,n,o,i,a,r,l,s,p,c,u,d,m,y,g,f,h,b,P,_,E,k,v,V,L){"use strict";function x(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,r.CornerType.ROUNDED),this._vertexFormat=m.VertexFormat.clone(e.defaultValue(n.vertexFormat,m.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let l=1+o.length*t.Cartesian3.packedLength;l+=1+i.length*t.Cartesian2.packedLength,this.packedLength=l+t.Ellipsoid.packedLength+m.VertexFormat.packedLength+2}x.pack=function(n,o,i){let a;i=e.defaultValue(i,0);const r=n._positions;let l=r.length;for(o[i++]=l,a=0;a<l;++a,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[a],o,i);const s=n._shape;for(l=s.length,o[i++]=l,a=0;a<l;++a,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(s[a],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,m.VertexFormat.pack(n._vertexFormat,o,i),i+=m.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),F=new m.VertexFormat,A={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,vertexFormat:F,cornerType:void 0,granularity:void 0};x.unpack=function(n,o,i){let a;o=e.defaultValue(o,0);let r=n[o++];const l=new Array(r);for(a=0;a<r;++a,o+=t.Cartesian3.packedLength)l[a]=t.Cartesian3.unpack(n,o);r=n[o++];const s=new Array(r);for(a=0;a<r;++a,o+=t.Cartesian2.packedLength)s[a]=t.Cartesian2.unpack(n,o);const p=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;const c=m.VertexFormat.unpack(n,o,F);o+=m.VertexFormat.packedLength;const u=n[o++],d=n[o];return e.defined(i)?(i._positions=l,i._shape=s,i._ellipsoid=t.Ellipsoid.clone(p,i._ellipsoid),i._vertexFormat=m.VertexFormat.clone(c,i._vertexFormat),i._cornerType=u,i._granularity=d,i):(A.polylinePositions=l,A.shapePositions=s,A.cornerType=u,A.granularity=d,new x(A))};const T=new o.BoundingRectangle;return x.createGeometry=function(e){const l=e._positions,m=n.arrayRemoveDuplicates(l,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=r.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),m.length<2||y.length<3)return;d.PolygonPipeline.computeWindingOrder2D(y)===d.WindingOrder.CLOCKWISE&&y.reverse();const g=o.BoundingRectangle.fromPoints(y,T);return function(e,t,n,o){const l=new p.GeometryAttributes;o.position&&(l.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const m=t.length,y=e.length/3,g=(y-2*m)/(2*m),f=d.PolygonPipeline.triangulate(t),h=(g-1)*m*6+2*f.length,b=u.IndexDatatype.createTypedArray(y,h);let P,_,E,k,v,V;const L=2*m;let x=0;for(P=0;P<g-1;P++){for(_=0;_<m-1;_++)E=2*_+P*m*2,V=E+L,k=E+1,v=k+L,b[x++]=k,b[x++]=E,b[x++]=v,b[x++]=v,b[x++]=E,b[x++]=V;E=2*m-2+P*m*2,k=E+1,v=k+L,V=E+L,b[x++]=k,b[x++]=E,b[x++]=v,b[x++]=v,b[x++]=E,b[x++]=V}if(o.st||o.tangent||o.bitangent){const e=new Float32Array(2*y),o=1/(g-1),i=1/n.height,r=n.height/2;let p,c,u=0;for(P=0;P<g;P++){for(p=P*o,c=i*(t[0].y+r),e[u++]=p,e[u++]=c,_=1;_<m;_++)c=i*(t[_].y+r),e[u++]=p,e[u++]=c,e[u++]=p,e[u++]=c;c=i*(t[0].y+r),e[u++]=p,e[u++]=c}for(_=0;_<m;_++)p=0,c=i*(t[_].y+r),e[u++]=p,e[u++]=c;for(_=0;_<m;_++)p=(g-1)*o,c=i*(t[_].y+r),e[u++]=p,e[u++]=c;l.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const C=y-2*m;for(P=0;P<f.length;P+=3){const e=f[P]+C,t=f[P+1]+C,n=f[P+2]+C;b[x++]=e,b[x++]=t,b[x++]=n,b[x++]=n+m,b[x++]=t+m,b[x++]=e+m}let F=new s.Geometry({attributes:l,indices:b,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(F=c.GeometryPipeline.computeNormal(F)),o.tangent||o.bitangent){try{F=c.GeometryPipeline.computeTangentAndBitangent(F)}catch(e){r.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(F.attributes.tangent=void 0),o.bitangent||(F.attributes.bitangent=void 0),o.st||(F.attributes.st=void 0)}return F}(r.PolylineVolumeGeometryLibrary.computePositions(m,y,g,e,!0),y,g,e._vertexFormat)},function(n,o){return e.defined(o)&&(n=x.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),x.createGeometry(n)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./arrayRemoveDuplicates-7d5d09a3","./BoundingRectangle-13e74a41","./Transforms-fdc0a95d","./ComponentDatatype-07fbb0d4","./PolylineVolumeGeometryLibrary-62034f07","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc"],(function(e,t,n,o,i,a,r,l,s,p,c,d,u,m,y,g,f,h,b,P,_,E,k,v,V,L){"use strict";function x(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,r.CornerType.ROUNDED),this._vertexFormat=m.VertexFormat.clone(e.defaultValue(n.vertexFormat,m.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let l=1+o.length*t.Cartesian3.packedLength;l+=1+i.length*t.Cartesian2.packedLength,this.packedLength=l+t.Ellipsoid.packedLength+m.VertexFormat.packedLength+2}x.pack=function(n,o,i){let a;i=e.defaultValue(i,0);const r=n._positions;let l=r.length;for(o[i++]=l,a=0;a<l;++a,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[a],o,i);const s=n._shape;for(l=s.length,o[i++]=l,a=0;a<l;++a,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(s[a],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,m.VertexFormat.pack(n._vertexFormat,o,i),i+=m.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),F=new m.VertexFormat,A={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,vertexFormat:F,cornerType:void 0,granularity:void 0};x.unpack=function(n,o,i){let a;o=e.defaultValue(o,0);let r=n[o++];const l=new Array(r);for(a=0;a<r;++a,o+=t.Cartesian3.packedLength)l[a]=t.Cartesian3.unpack(n,o);r=n[o++];const s=new Array(r);for(a=0;a<r;++a,o+=t.Cartesian2.packedLength)s[a]=t.Cartesian2.unpack(n,o);const p=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;const c=m.VertexFormat.unpack(n,o,F);o+=m.VertexFormat.packedLength;const d=n[o++],u=n[o];return e.defined(i)?(i._positions=l,i._shape=s,i._ellipsoid=t.Ellipsoid.clone(p,i._ellipsoid),i._vertexFormat=m.VertexFormat.clone(c,i._vertexFormat),i._cornerType=d,i._granularity=u,i):(A.polylinePositions=l,A.shapePositions=s,A.cornerType=d,A.granularity=u,new x(A))};const T=new o.BoundingRectangle;return x.createGeometry=function(e){const l=e._positions,m=n.arrayRemoveDuplicates(l,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=r.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),m.length<2||y.length<3)return;u.PolygonPipeline.computeWindingOrder2D(y)===u.WindingOrder.CLOCKWISE&&y.reverse();const g=o.BoundingRectangle.fromPoints(y,T);return function(e,t,n,o){const l=new p.GeometryAttributes;o.position&&(l.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const m=t.length,y=e.length/3,g=(y-2*m)/(2*m),f=u.PolygonPipeline.triangulate(t),h=(g-1)*m*6+2*f.length,b=d.IndexDatatype.createTypedArray(y,h);let P,_,E,k,v,V;const L=2*m;let x=0;for(P=0;P<g-1;P++){for(_=0;_<m-1;_++)E=2*_+P*m*2,V=E+L,k=E+1,v=k+L,b[x++]=k,b[x++]=E,b[x++]=v,b[x++]=v,b[x++]=E,b[x++]=V;E=2*m-2+P*m*2,k=E+1,v=k+L,V=E+L,b[x++]=k,b[x++]=E,b[x++]=v,b[x++]=v,b[x++]=E,b[x++]=V}if(o.st||o.tangent||o.bitangent){const e=new Float32Array(2*y),o=1/(g-1),i=1/n.height,r=n.height/2;let p,c,d=0;for(P=0;P<g;P++){for(p=P*o,c=i*(t[0].y+r),e[d++]=p,e[d++]=c,_=1;_<m;_++)c=i*(t[_].y+r),e[d++]=p,e[d++]=c,e[d++]=p,e[d++]=c;c=i*(t[0].y+r),e[d++]=p,e[d++]=c}for(_=0;_<m;_++)p=0,c=i*(t[_].y+r),e[d++]=p,e[d++]=c;for(_=0;_<m;_++)p=(g-1)*o,c=i*(t[_].y+r),e[d++]=p,e[d++]=c;l.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const C=y-2*m;for(P=0;P<f.length;P+=3){const e=f[P]+C,t=f[P+1]+C,n=f[P+2]+C;b[x++]=e,b[x++]=t,b[x++]=n,b[x++]=n+m,b[x++]=t+m,b[x++]=e+m}let F=new s.Geometry({attributes:l,indices:b,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(F=c.GeometryPipeline.computeNormal(F)),o.tangent||o.bitangent){try{F=c.GeometryPipeline.computeTangentAndBitangent(F)}catch(e){r.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(F.attributes.tangent=void 0),o.bitangent||(F.attributes.bitangent=void 0),o.st||(F.attributes.st=void 0)}return F}(r.PolylineVolumeGeometryLibrary.computePositions(m,y,g,e,!0),y,g,e._vertexFormat)},function(n,o){return e.defined(o)&&(n=x.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),x.createGeometry(n)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./arrayRemoveDuplicates-fe254feb","./BoundingRectangle-00ff5b29","./Transforms-06c05e21","./ComponentDatatype-a9820060","./PolylineVolumeGeometryLibrary-c9777b58","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4"],(function(e,t,n,i,o,a,l,r,s,p,c,d,u,y,f,g,h,m,E,_,P,b){"use strict";function k(n){const i=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,o=n.shapePositions;this._positions=i,this._shape=o,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._granularity=e.defaultValue(n.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let r=1+i.length*t.Cartesian3.packedLength;r+=1+o.length*t.Cartesian2.packedLength,this.packedLength=r+t.Ellipsoid.packedLength+2}k.pack=function(n,i,o){let a;o=e.defaultValue(o,0);const l=n._positions;let r=l.length;for(i[o++]=r,a=0;a<r;++a,o+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],i,o);const s=n._shape;for(r=s.length,i[o++]=r,a=0;a<r;++a,o+=t.Cartesian2.packedLength)t.Cartesian2.pack(s[a],i,o);return t.Ellipsoid.pack(n._ellipsoid,i,o),o+=t.Ellipsoid.packedLength,i[o++]=n._cornerType,i[o]=n._granularity,i};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),L={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,height:void 0,cornerType:void 0,granularity:void 0};k.unpack=function(n,i,o){let a;i=e.defaultValue(i,0);let l=n[i++];const r=new Array(l);for(a=0;a<l;++a,i+=t.Cartesian3.packedLength)r[a]=t.Cartesian3.unpack(n,i);l=n[i++];const s=new Array(l);for(a=0;a<l;++a,i+=t.Cartesian2.packedLength)s[a]=t.Cartesian2.unpack(n,i);const p=t.Ellipsoid.unpack(n,i,C);i+=t.Ellipsoid.packedLength;const c=n[i++],d=n[i];return e.defined(o)?(o._positions=r,o._shape=s,o._ellipsoid=t.Ellipsoid.clone(p,o._ellipsoid),o._cornerType=c,o._granularity=d,o):(L.polylinePositions=r,L.shapePositions=s,L.cornerType=c,L.granularity=d,new k(L))};const T=new i.BoundingRectangle;return k.createGeometry=function(e){const r=e._positions,u=n.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),u.length<2||y.length<3)return;d.PolygonPipeline.computeWindingOrder2D(y)===d.WindingOrder.CLOCKWISE&&y.reverse();const f=i.BoundingRectangle.fromPoints(y,T);return function(e,t){const n=new p.GeometryAttributes;n.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});const i=t.length,l=n.position.values.length/3,r=e.length/3/i,d=c.IndexDatatype.createTypedArray(l,2*i*(r+1));let u,y,f=0;u=0;let g=u*i;for(y=0;y<i-1;y++)d[f++]=y+g,d[f++]=y+g+1;for(d[f++]=i-1+g,d[f++]=g,u=r-1,g=u*i,y=0;y<i-1;y++)d[f++]=y+g,d[f++]=y+g+1;for(d[f++]=i-1+g,d[f++]=g,u=0;u<r-1;u++){const e=i*u,t=e+i;for(y=0;y<i;y++)d[f++]=y+e,d[f++]=y+t}return new s.Geometry({attributes:n,indices:c.IndexDatatype.createTypedArray(l,d),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES})}(l.PolylineVolumeGeometryLibrary.computePositions(u,y,f,e,!1),y)},function(n,i){return e.defined(i)&&(n=k.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),k.createGeometry(n)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./arrayRemoveDuplicates-7d5d09a3","./BoundingRectangle-13e74a41","./Transforms-fdc0a95d","./ComponentDatatype-07fbb0d4","./PolylineVolumeGeometryLibrary-62034f07","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738"],(function(e,t,n,i,o,a,l,r,s,p,d,c,u,y,f,g,h,m,E,_,P,b){"use strict";function k(n){const i=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,o=n.shapePositions;this._positions=i,this._shape=o,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._granularity=e.defaultValue(n.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let r=1+i.length*t.Cartesian3.packedLength;r+=1+o.length*t.Cartesian2.packedLength,this.packedLength=r+t.Ellipsoid.packedLength+2}k.pack=function(n,i,o){let a;o=e.defaultValue(o,0);const l=n._positions;let r=l.length;for(i[o++]=r,a=0;a<r;++a,o+=t.Cartesian3.packedLength)t.Cartesian3.pack(l[a],i,o);const s=n._shape;for(r=s.length,i[o++]=r,a=0;a<r;++a,o+=t.Cartesian2.packedLength)t.Cartesian2.pack(s[a],i,o);return t.Ellipsoid.pack(n._ellipsoid,i,o),o+=t.Ellipsoid.packedLength,i[o++]=n._cornerType,i[o]=n._granularity,i};const C=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),L={polylinePositions:void 0,shapePositions:void 0,ellipsoid:C,height:void 0,cornerType:void 0,granularity:void 0};k.unpack=function(n,i,o){let a;i=e.defaultValue(i,0);let l=n[i++];const r=new Array(l);for(a=0;a<l;++a,i+=t.Cartesian3.packedLength)r[a]=t.Cartesian3.unpack(n,i);l=n[i++];const s=new Array(l);for(a=0;a<l;++a,i+=t.Cartesian2.packedLength)s[a]=t.Cartesian2.unpack(n,i);const p=t.Ellipsoid.unpack(n,i,C);i+=t.Ellipsoid.packedLength;const d=n[i++],c=n[i];return e.defined(o)?(o._positions=r,o._shape=s,o._ellipsoid=t.Ellipsoid.clone(p,o._ellipsoid),o._cornerType=d,o._granularity=c,o):(L.polylinePositions=r,L.shapePositions=s,L.cornerType=d,L.granularity=c,new k(L))};const T=new i.BoundingRectangle;return k.createGeometry=function(e){const r=e._positions,u=n.arrayRemoveDuplicates(r,t.Cartesian3.equalsEpsilon);let y=e._shape;if(y=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(y),u.length<2||y.length<3)return;c.PolygonPipeline.computeWindingOrder2D(y)===c.WindingOrder.CLOCKWISE&&y.reverse();const f=i.BoundingRectangle.fromPoints(y,T);return function(e,t){const n=new p.GeometryAttributes;n.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});const i=t.length,l=n.position.values.length/3,r=e.length/3/i,c=d.IndexDatatype.createTypedArray(l,2*i*(r+1));let u,y,f=0;u=0;let g=u*i;for(y=0;y<i-1;y++)c[f++]=y+g,c[f++]=y+g+1;for(c[f++]=i-1+g,c[f++]=g,u=r-1,g=u*i,y=0;y<i-1;y++)c[f++]=y+g,c[f++]=y+g+1;for(c[f++]=i-1+g,c[f++]=g,u=0;u<r-1;u++){const e=i*u,t=e+i;for(y=0;y<i;y++)c[f++]=y+e,c[f++]=y+t}return new s.Geometry({attributes:n,indices:d.IndexDatatype.createTypedArray(l,c),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES})}(l.PolylineVolumeGeometryLibrary.computePositions(u,y,f,e,!1),y)},function(n,i){return e.defined(i)&&(n=k.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),k.createGeometry(n)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./GeometryInstance-19ac39d5","./GeometryPipeline-311a1f9e","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./RectangleGeometryLibrary-dfe005a4","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AttributeCompression-6e71d14f","./EncodedCartesian3-20914bf5","./IntersectionTests-94cb8698","./Plane-042297c7","./EllipsoidRhumbLine-94e77fa4"],(function(t,e,n,a,o,r,i,s,l,u,c,m,p,d,g,y,f,h,b,_,A,x){"use strict";const w=new e.Cartesian3,C=new e.Cartesian3,v=new e.Cartesian3,R=new e.Cartesian3,E=new e.Rectangle,F=new e.Cartesian2,G=new a.BoundingSphere,P=new a.BoundingSphere;function V(t,e){const n=new i.Geometry({attributes:new s.GeometryAttributes,primitiveType:i.PrimitiveType.TRIANGLES});return n.attributes.position=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}const L=new e.Cartesian3,D=new e.Cartesian3;function M(t,n){const a=t._vertexFormat,o=t._ellipsoid,s=n.height,l=n.width,u=n.northCap,m=n.southCap;let d=0,g=s,y=s,f=0;u&&(d=1,y-=1,f+=1),m&&(g-=1,y-=1,f+=1),f+=l*y;const h=a.position?new Float64Array(3*f):void 0,b=a.st?new Float32Array(2*f):void 0;let _=0,A=0;const x=w,E=F;let G=Number.MAX_VALUE,P=Number.MAX_VALUE,L=-Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let t=d;t<g;++t)for(let e=0;e<l;++e)p.RectangleGeometryLibrary.computePosition(n,o,a.st,t,e,x,E),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=E.x,b[A++]=E.y,G=Math.min(G,E.x),P=Math.min(P,E.y),L=Math.max(L,E.x),D=Math.max(D,E.y));if(u&&(p.RectangleGeometryLibrary.computePosition(n,o,a.st,0,0,x,E),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=E.x,b[A++]=E.y,G=E.x,P=E.y,L=E.x,D=E.y)),m&&(p.RectangleGeometryLibrary.computePosition(n,o,a.st,s-1,0,x,E),h[_++]=x.x,h[_++]=x.y,h[_]=x.z,a.st&&(b[A++]=E.x,b[A]=E.y,G=Math.min(G,E.x),P=Math.min(P,E.y),L=Math.max(L,E.x),D=Math.max(D,E.y))),a.st&&(G<0||P<0||L>1||D>1))for(let t=0;t<b.length;t+=2)b[t]=(b[t]-G)/(L-G),b[t+1]=(b[t+1]-P)/(D-P);const M=function(t,n,a,o){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let u=0;const c=R,m=v;let p=C;if(n.normal||n.tangent||n.bitangent)for(let d=0;d<r;d+=3){const r=e.Cartesian3.fromArray(t,d,w),g=u+1,y=u+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,c),c)),n.normal&&(i[u]=p.x,i[g]=p.y,i[y]=p.z),n.tangent&&(s[u]=m.x,s[g]=m.y,s[y]=m.z),n.bitangent&&(l[u]=c.x,l[g]=c.y,l[y]=c.z),u+=3}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}(h,a,o,n.tangentRotationMatrix);let T=6*(l-1)*(y-1);u&&(T+=3*(l-1)),m&&(T+=3*(l-1));const O=c.IndexDatatype.createTypedArray(f,T);let N,S=0,I=0;for(N=0;N<y-1;++N){for(let t=0;t<l-1;++t){const t=S,e=t+l,n=e+1,a=t+1;O[I++]=t,O[I++]=e,O[I++]=a,O[I++]=a,O[I++]=e,O[I++]=n,++S}++S}if(u||m){let t=f-1;const e=f-1;let n,a;if(u&&m&&(t=f-2),S=0,u)for(N=0;N<l-1;N++)n=S,a=n+1,O[I++]=t,O[I++]=n,O[I++]=a,++S;if(m)for(S=(y-1)*l,N=0;N<l-1;N++)n=S,a=n+1,O[I++]=n,O[I++]=e,O[I++]=a,++S}return M.indices=O,a.st&&(M.attributes.st=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:b})),M}function T(t,e,n,a,o){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}function O(t,e,n,a){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}const N=new d.VertexFormat;function S(a,o){const s=a._shadowVolume,p=a._offsetAttribute,g=a._vertexFormat,y=a._extrudedHeight,f=a._surfaceHeight,h=a._ellipsoid,b=o.height,_=o.width;let A;if(s){const t=d.VertexFormat.clone(g,N);t.normal=!0,a._vertexFormat=t}const x=M(a,o);s&&(a._vertexFormat=g);let E=m.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,f,h,!1);E=new Float64Array(E);let F=E.length;const G=2*F,P=new Float64Array(G);P.set(E);const S=m.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,y,h);P.set(S,F),x.attributes.position.values=P;const I=g.normal?new Float32Array(G):void 0,k=g.tangent?new Float32Array(G):void 0,H=g.bitangent?new Float32Array(G):void 0,z=g.st?new Float32Array(G/3*2):void 0;let B,U,Y;if(g.normal){for(U=x.attributes.normal.values,I.set(U),A=0;A<F;A++)U[A]=-U[A];I.set(U,F),x.attributes.normal.values=I}if(s){U=x.attributes.normal.values,g.normal||(x.attributes.normal=void 0);const t=new Float32Array(G);for(A=0;A<F;A++)U[A]=-U[A];t.set(U,F),x.attributes.extrudeDirection=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}const q=t.defined(p);if(q){const t=F/3*2;let e=new Uint8Array(t);p===n.GeometryOffsetAttribute.TOP?e=n.arrayFill(e,1,0,t/2):(Y=p===n.GeometryOffsetAttribute.NONE?0:1,e=n.arrayFill(e,Y)),x.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(g.tangent){const t=x.attributes.tangent.values;for(k.set(t),A=0;A<F;A++)t[A]=-t[A];k.set(t,F),x.attributes.tangent.values=k}if(g.bitangent){const t=x.attributes.bitangent.values;H.set(t),H.set(t,F),x.attributes.bitangent.values=H}g.st&&(B=x.attributes.st.values,z.set(B),z.set(B,F/3*2),x.attributes.st.values=z);const X=x.indices,Q=X.length,W=F/3,j=c.IndexDatatype.createTypedArray(G/3,2*Q);for(j.set(X),A=0;A<Q;A+=3)j[A+Q]=X[A+2]+W,j[A+1+Q]=X[A+1]+W,j[A+2+Q]=X[A]+W;x.indices=j;const J=o.northCap,Z=o.southCap;let K=b,$=2,tt=0,et=4,nt=4;J&&($-=1,K-=1,tt+=1,et-=2,nt-=1),Z&&($-=1,K-=1,tt+=1,et-=2,nt-=1),tt+=$*_+2*K-et;const at=2*(tt+nt);let ot=new Float64Array(3*at);const rt=s?new Float32Array(3*at):void 0;let it=q?new Uint8Array(at):void 0,st=g.st?new Float32Array(2*at):void 0;const lt=p===n.GeometryOffsetAttribute.TOP;q&&!lt&&(Y=p===n.GeometryOffsetAttribute.ALL?1:0,it=n.arrayFill(it,Y));let ut=0,ct=0,mt=0,pt=0;const dt=_*K;let gt;for(A=0;A<dt;A+=_)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);if(Z){const t=J?dt+1:dt;for(gt=3*t,A=0;A<2;A++)ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*t,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1)}else for(A=dt-_;A<dt;A++)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);for(A=dt-1;A>0;A-=_)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);if(J){const t=dt;for(gt=3*t,A=0;A<2;A++)ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*t,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1)}else for(A=_-1;A>=0;A--)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);let yt=function(t,n,a){const o=t.length,i=n.normal?new Float32Array(o):void 0,s=n.tangent?new Float32Array(o):void 0,l=n.bitangent?new Float32Array(o):void 0;let u=0,c=0,m=0,p=!0,d=R,g=v,y=C;if(n.normal||n.tangent||n.bitangent)for(let f=0;f<o;f+=6){const h=e.Cartesian3.fromArray(t,f,w),b=e.Cartesian3.fromArray(t,(f+6)%o,L);if(p){const n=e.Cartesian3.fromArray(t,(f+3)%o,D);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,r.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(d=a.geodeticSurfaceNormal(h,d),n.tangent&&(g=e.Cartesian3.normalize(e.Cartesian3.cross(d,y,g),g))),n.normal&&(i[u++]=y.x,i[u++]=y.y,i[u++]=y.z,i[u++]=y.x,i[u++]=y.y,i[u++]=y.z),n.tangent&&(s[c++]=g.x,s[c++]=g.y,s[c++]=g.z,s[c++]=g.x,s[c++]=g.y,s[c++]=g.z),n.bitangent&&(l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=d.x,l[m++]=d.y,l[m++]=d.z)}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}(ot,g,h);g.st&&(yt.attributes.st=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:st})),s&&(yt.attributes.extrudeDirection=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:rt})),q&&(yt.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:it}));const ft=c.IndexDatatype.createTypedArray(at,6*tt);let ht,bt,_t,At;F=ot.length/3;let xt=0;for(A=0;A<F-1;A+=2){ht=A,At=(ht+2)%F;const t=e.Cartesian3.fromArray(ot,3*ht,L),n=e.Cartesian3.fromArray(ot,3*At,D);e.Cartesian3.equalsEpsilon(t,n,r.CesiumMath.EPSILON10)||(bt=(ht+1)%F,_t=(bt+2)%F,ft[xt++]=ht,ft[xt++]=bt,ft[xt++]=At,ft[xt++]=At,ft[xt++]=bt,ft[xt++]=_t)}return yt.indices=ft,yt=u.GeometryPipeline.combineInstances([new l.GeometryInstance({geometry:x}),new l.GeometryInstance({geometry:yt})]),yt[0]}const I=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3],k=new e.Cartographic,H=new e.Cartographic;function z(t,n,a,o,r){if(0===a)return e.Rectangle.clone(t,r);const i=p.RectangleGeometryLibrary.computeOptions(t,n,a,0,E,k),s=i.height,l=i.width,u=I;return p.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,u[0]),p.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,u[1]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,u[2]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,u[3]),e.Rectangle.fromCartesianArray(u,o,r)}function B(n){const a=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,o=t.defaultValue(n.height,0),i=t.defaultValue(n.extrudedHeight,o);this._rectangle=e.Rectangle.clone(a),this._granularity=t.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(o,i),this._rotation=t.defaultValue(n.rotation,0),this._stRotation=t.defaultValue(n.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(n.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(o,i),this._shadowVolume=t.defaultValue(n.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=n.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}B.packedLength=e.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,B.pack=function(n,a,o){return o=t.defaultValue(o,0),e.Rectangle.pack(n._rectangle,a,o),o+=e.Rectangle.packedLength,e.Ellipsoid.pack(n._ellipsoid,a,o),o+=e.Ellipsoid.packedLength,d.VertexFormat.pack(n._vertexFormat,a,o),o+=d.VertexFormat.packedLength,a[o++]=n._granularity,a[o++]=n._surfaceHeight,a[o++]=n._rotation,a[o++]=n._stRotation,a[o++]=n._extrudedHeight,a[o++]=n._shadowVolume?1:0,a[o]=t.defaultValue(n._offsetAttribute,-1),a};const U=new e.Rectangle,Y=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),q={rectangle:U,ellipsoid:Y,vertexFormat:N,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};B.unpack=function(n,a,o){a=t.defaultValue(a,0);const r=e.Rectangle.unpack(n,a,U);a+=e.Rectangle.packedLength;const i=e.Ellipsoid.unpack(n,a,Y);a+=e.Ellipsoid.packedLength;const s=d.VertexFormat.unpack(n,a,N);a+=d.VertexFormat.packedLength;const l=n[a++],u=n[a++],c=n[a++],m=n[a++],p=n[a++],g=1===n[a++],y=n[a];return t.defined(o)?(o._rectangle=e.Rectangle.clone(r,o._rectangle),o._ellipsoid=e.Ellipsoid.clone(i,o._ellipsoid),o._vertexFormat=d.VertexFormat.clone(s,o._vertexFormat),o._granularity=l,o._surfaceHeight=u,o._rotation=c,o._stRotation=m,o._extrudedHeight=p,o._shadowVolume=g,o._offsetAttribute=-1===y?void 0:y,o):(q.granularity=l,q.height=u,q.rotation=c,q.stRotation=m,q.extrudedHeight=p,q.shadowVolume=g,q.offsetAttribute=-1===y?void 0:y,new B(q))},B.computeRectangle=function(n,a){const o=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,i=t.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),s=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84);return z(o,i,t.defaultValue(n.rotation,0),s,a)};const X=new e.Matrix3,Q=new a.Quaternion,W=new e.Cartographic;B.createGeometry=function(o){if(r.CesiumMath.equalsEpsilon(o._rectangle.north,o._rectangle.south,r.CesiumMath.EPSILON10)||r.CesiumMath.equalsEpsilon(o._rectangle.east,o._rectangle.west,r.CesiumMath.EPSILON10))return;let s=o._rectangle;const l=o._ellipsoid,u=o._rotation,c=o._stRotation,d=o._vertexFormat,g=p.RectangleGeometryLibrary.computeOptions(s,o._granularity,u,c,E,k,H),y=X;if(0!==c||0!==u){const t=e.Rectangle.center(s,W),n=l.geodeticSurfaceNormalCartographic(t,L);a.Quaternion.fromAxisAngle(n,-c,Q),e.Matrix3.fromQuaternion(Q,y)}else e.Matrix3.clone(e.Matrix3.IDENTITY,y);const f=o._surfaceHeight,h=o._extrudedHeight,b=!r.CesiumMath.equalsEpsilon(f,h,0,r.CesiumMath.EPSILON2);let _,A;if(g.lonScalar=1/o._rectangle.width,g.latScalar=1/o._rectangle.height,g.tangentRotationMatrix=y,s=o._rectangle,b){_=S(o,g);const t=a.BoundingSphere.fromRectangle3D(s,l,f,P),e=a.BoundingSphere.fromRectangle3D(s,l,h,G);A=a.BoundingSphere.union(t,e)}else{if(_=M(o,g),_.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,f,l,!1),t.defined(o._offsetAttribute)){const t=_.attributes.position.values.length,e=new Uint8Array(t/3),a=o._offsetAttribute===n.GeometryOffsetAttribute.NONE?0:1;n.arrayFill(e,a),_.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}A=a.BoundingSphere.fromRectangle3D(s,l,f)}return d.position||delete _.attributes.position,new i.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:A,offsetAttribute:o._offsetAttribute})},B.createShadowVolume=function(t,e,n){const a=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);return new B({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};const j=new e.Rectangle,J=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],Z=new e.Matrix2,K=new e.Cartographic;return Object.defineProperties(B.prototype,{rectangle:{get:function(){return t.defined(this._rotatedRectangle)||(this._rotatedRectangle=z(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];const n=e.Rectangle.clone(t._rectangle,j),a=t._granularity,o=t._ellipsoid,r=z(n,a,t._rotation-t._stRotation,o,j),i=J;i[0].x=r.west,i[0].y=r.south,i[1].x=r.west,i[1].y=r.north,i[2].x=r.east,i[2].y=r.south;const s=t.rectangle,l=e.Matrix2.fromRotation(t._stRotation,Z),u=e.Rectangle.center(s,K);for(let t=0;t<3;++t){const n=i[t];n.x-=u.longitude,n.y-=u.latitude,e.Matrix2.multiplyByVector(l,n,n),n.x+=u.longitude,n.y+=u.latitude,n.x=(n.x-s.west)/s.width,n.y=(n.y-s.south)/s.height}const c=i[0],m=i[1],p=i[2],d=new Array(6);return e.Cartesian2.pack(c,d),e.Cartesian2.pack(m,d,2),e.Cartesian2.pack(p,d,4),d}(this)),this._textureCoordinateRotationPoints}}}),function(n,a){return t.defined(a)&&(n=B.unpack(n,a)),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),n._rectangle=e.Rectangle.clone(n._rectangle),B.createGeometry(n)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./GeometryInstance-5555f2e4","./GeometryPipeline-20b6a6da","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./RectangleGeometryLibrary-12a48ca5","./VertexFormat-e68722dd","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./AttributeCompression-4c4a8822","./EncodedCartesian3-8da855cc","./IntersectionTests-4547e13f","./Plane-faef0199","./EllipsoidRhumbLine-001b8738"],(function(t,e,n,a,o,r,i,s,l,u,c,m,p,d,g,y,f,h,b,_,A,x){"use strict";const w=new e.Cartesian3,C=new e.Cartesian3,v=new e.Cartesian3,R=new e.Cartesian3,E=new e.Rectangle,F=new e.Cartesian2,G=new a.BoundingSphere,P=new a.BoundingSphere;function V(t,e){const n=new i.Geometry({attributes:new s.GeometryAttributes,primitiveType:i.PrimitiveType.TRIANGLES});return n.attributes.position=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}const L=new e.Cartesian3,D=new e.Cartesian3;function M(t,n){const a=t._vertexFormat,o=t._ellipsoid,s=n.height,l=n.width,u=n.northCap,m=n.southCap;let d=0,g=s,y=s,f=0;u&&(d=1,y-=1,f+=1),m&&(g-=1,y-=1,f+=1),f+=l*y;const h=a.position?new Float64Array(3*f):void 0,b=a.st?new Float32Array(2*f):void 0;let _=0,A=0;const x=w,E=F;let G=Number.MAX_VALUE,P=Number.MAX_VALUE,L=-Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let t=d;t<g;++t)for(let e=0;e<l;++e)p.RectangleGeometryLibrary.computePosition(n,o,a.st,t,e,x,E),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=E.x,b[A++]=E.y,G=Math.min(G,E.x),P=Math.min(P,E.y),L=Math.max(L,E.x),D=Math.max(D,E.y));if(u&&(p.RectangleGeometryLibrary.computePosition(n,o,a.st,0,0,x,E),h[_++]=x.x,h[_++]=x.y,h[_++]=x.z,a.st&&(b[A++]=E.x,b[A++]=E.y,G=E.x,P=E.y,L=E.x,D=E.y)),m&&(p.RectangleGeometryLibrary.computePosition(n,o,a.st,s-1,0,x,E),h[_++]=x.x,h[_++]=x.y,h[_]=x.z,a.st&&(b[A++]=E.x,b[A]=E.y,G=Math.min(G,E.x),P=Math.min(P,E.y),L=Math.max(L,E.x),D=Math.max(D,E.y))),a.st&&(G<0||P<0||L>1||D>1))for(let t=0;t<b.length;t+=2)b[t]=(b[t]-G)/(L-G),b[t+1]=(b[t+1]-P)/(D-P);const M=function(t,n,a,o){const r=t.length,i=n.normal?new Float32Array(r):void 0,s=n.tangent?new Float32Array(r):void 0,l=n.bitangent?new Float32Array(r):void 0;let u=0;const c=R,m=v;let p=C;if(n.normal||n.tangent||n.bitangent)for(let d=0;d<r;d+=3){const r=e.Cartesian3.fromArray(t,d,w),g=u+1,y=u+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,c),c)),n.normal&&(i[u]=p.x,i[g]=p.y,i[y]=p.z),n.tangent&&(s[u]=m.x,s[g]=m.y,s[y]=m.z),n.bitangent&&(l[u]=c.x,l[g]=c.y,l[y]=c.z),u+=3}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}(h,a,o,n.tangentRotationMatrix);let T=6*(l-1)*(y-1);u&&(T+=3*(l-1)),m&&(T+=3*(l-1));const O=c.IndexDatatype.createTypedArray(f,T);let N,S=0,I=0;for(N=0;N<y-1;++N){for(let t=0;t<l-1;++t){const t=S,e=t+l,n=e+1,a=t+1;O[I++]=t,O[I++]=e,O[I++]=a,O[I++]=a,O[I++]=e,O[I++]=n,++S}++S}if(u||m){let t=f-1;const e=f-1;let n,a;if(u&&m&&(t=f-2),S=0,u)for(N=0;N<l-1;N++)n=S,a=n+1,O[I++]=t,O[I++]=n,O[I++]=a,++S;if(m)for(S=(y-1)*l,N=0;N<l-1;N++)n=S,a=n+1,O[I++]=n,O[I++]=e,O[I++]=a,++S}return M.indices=O,a.st&&(M.attributes.st=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:b})),M}function T(t,e,n,a,o){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}function O(t,e,n,a){return t[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}const N=new d.VertexFormat;function S(a,o){const s=a._shadowVolume,p=a._offsetAttribute,g=a._vertexFormat,y=a._extrudedHeight,f=a._surfaceHeight,h=a._ellipsoid,b=o.height,_=o.width;let A;if(s){const t=d.VertexFormat.clone(g,N);t.normal=!0,a._vertexFormat=t}const x=M(a,o);s&&(a._vertexFormat=g);let E=m.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,f,h,!1);E=new Float64Array(E);let F=E.length;const G=2*F,P=new Float64Array(G);P.set(E);const S=m.PolygonPipeline.scaleToGeodeticHeight(x.attributes.position.values,y,h);P.set(S,F),x.attributes.position.values=P;const I=g.normal?new Float32Array(G):void 0,k=g.tangent?new Float32Array(G):void 0,H=g.bitangent?new Float32Array(G):void 0,z=g.st?new Float32Array(G/3*2):void 0;let B,U,Y;if(g.normal){for(U=x.attributes.normal.values,I.set(U),A=0;A<F;A++)U[A]=-U[A];I.set(U,F),x.attributes.normal.values=I}if(s){U=x.attributes.normal.values,g.normal||(x.attributes.normal=void 0);const t=new Float32Array(G);for(A=0;A<F;A++)U[A]=-U[A];t.set(U,F),x.attributes.extrudeDirection=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}const q=t.defined(p);if(q){const t=F/3*2;let e=new Uint8Array(t);p===n.GeometryOffsetAttribute.TOP?e=n.arrayFill(e,1,0,t/2):(Y=p===n.GeometryOffsetAttribute.NONE?0:1,e=n.arrayFill(e,Y)),x.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(g.tangent){const t=x.attributes.tangent.values;for(k.set(t),A=0;A<F;A++)t[A]=-t[A];k.set(t,F),x.attributes.tangent.values=k}if(g.bitangent){const t=x.attributes.bitangent.values;H.set(t),H.set(t,F),x.attributes.bitangent.values=H}g.st&&(B=x.attributes.st.values,z.set(B),z.set(B,F/3*2),x.attributes.st.values=z);const X=x.indices,Q=X.length,W=F/3,j=c.IndexDatatype.createTypedArray(G/3,2*Q);for(j.set(X),A=0;A<Q;A+=3)j[A+Q]=X[A+2]+W,j[A+1+Q]=X[A+1]+W,j[A+2+Q]=X[A]+W;x.indices=j;const J=o.northCap,Z=o.southCap;let K=b,$=2,tt=0,et=4,nt=4;J&&($-=1,K-=1,tt+=1,et-=2,nt-=1),Z&&($-=1,K-=1,tt+=1,et-=2,nt-=1),tt+=$*_+2*K-et;const at=2*(tt+nt);let ot=new Float64Array(3*at);const rt=s?new Float32Array(3*at):void 0;let it=q?new Uint8Array(at):void 0,st=g.st?new Float32Array(2*at):void 0;const lt=p===n.GeometryOffsetAttribute.TOP;q&&!lt&&(Y=p===n.GeometryOffsetAttribute.ALL?1:0,it=n.arrayFill(it,Y));let ut=0,ct=0,mt=0,pt=0;const dt=_*K;let gt;for(A=0;A<dt;A+=_)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);if(Z){const t=J?dt+1:dt;for(gt=3*t,A=0;A<2;A++)ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*t,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1)}else for(A=dt-_;A<dt;A++)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);for(A=dt-1;A>0;A-=_)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);if(J){const t=dt;for(gt=3*t,A=0;A<2;A++)ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*t,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1)}else for(A=_-1;A>=0;A--)gt=3*A,ot=T(ot,ut,gt,E,S),ut+=6,g.st&&(st=O(st,ct,2*A,B),ct+=4),s&&(mt+=3,rt[mt++]=U[gt],rt[mt++]=U[gt+1],rt[mt++]=U[gt+2]),lt&&(it[pt++]=1,pt+=1);let yt=function(t,n,a){const o=t.length,i=n.normal?new Float32Array(o):void 0,s=n.tangent?new Float32Array(o):void 0,l=n.bitangent?new Float32Array(o):void 0;let u=0,c=0,m=0,p=!0,d=R,g=v,y=C;if(n.normal||n.tangent||n.bitangent)for(let f=0;f<o;f+=6){const h=e.Cartesian3.fromArray(t,f,w),b=e.Cartesian3.fromArray(t,(f+6)%o,L);if(p){const n=e.Cartesian3.fromArray(t,(f+3)%o,D);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,r.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(d=a.geodeticSurfaceNormal(h,d),n.tangent&&(g=e.Cartesian3.normalize(e.Cartesian3.cross(d,y,g),g))),n.normal&&(i[u++]=y.x,i[u++]=y.y,i[u++]=y.z,i[u++]=y.x,i[u++]=y.y,i[u++]=y.z),n.tangent&&(s[c++]=g.x,s[c++]=g.y,s[c++]=g.z,s[c++]=g.x,s[c++]=g.y,s[c++]=g.z),n.bitangent&&(l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=d.x,l[m++]=d.y,l[m++]=d.z)}return V(n,{positions:t,normals:i,tangents:s,bitangents:l})}(ot,g,h);g.st&&(yt.attributes.st=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:st})),s&&(yt.attributes.extrudeDirection=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:rt})),q&&(yt.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:it}));const ft=c.IndexDatatype.createTypedArray(at,6*tt);let ht,bt,_t,At;F=ot.length/3;let xt=0;for(A=0;A<F-1;A+=2){ht=A,At=(ht+2)%F;const t=e.Cartesian3.fromArray(ot,3*ht,L),n=e.Cartesian3.fromArray(ot,3*At,D);e.Cartesian3.equalsEpsilon(t,n,r.CesiumMath.EPSILON10)||(bt=(ht+1)%F,_t=(bt+2)%F,ft[xt++]=ht,ft[xt++]=bt,ft[xt++]=At,ft[xt++]=At,ft[xt++]=bt,ft[xt++]=_t)}return yt.indices=ft,yt=u.GeometryPipeline.combineInstances([new l.GeometryInstance({geometry:x}),new l.GeometryInstance({geometry:yt})]),yt[0]}const I=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3],k=new e.Cartographic,H=new e.Cartographic;function z(t,n,a,o,r){if(0===a)return e.Rectangle.clone(t,r);const i=p.RectangleGeometryLibrary.computeOptions(t,n,a,0,E,k),s=i.height,l=i.width,u=I;return p.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,u[0]),p.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,u[1]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,u[2]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,u[3]),e.Rectangle.fromCartesianArray(u,o,r)}function B(n){const a=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,o=t.defaultValue(n.height,0),i=t.defaultValue(n.extrudedHeight,o);this._rectangle=e.Rectangle.clone(a),this._granularity=t.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(o,i),this._rotation=t.defaultValue(n.rotation,0),this._stRotation=t.defaultValue(n.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(n.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(o,i),this._shadowVolume=t.defaultValue(n.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=n.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}B.packedLength=e.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,B.pack=function(n,a,o){return o=t.defaultValue(o,0),e.Rectangle.pack(n._rectangle,a,o),o+=e.Rectangle.packedLength,e.Ellipsoid.pack(n._ellipsoid,a,o),o+=e.Ellipsoid.packedLength,d.VertexFormat.pack(n._vertexFormat,a,o),o+=d.VertexFormat.packedLength,a[o++]=n._granularity,a[o++]=n._surfaceHeight,a[o++]=n._rotation,a[o++]=n._stRotation,a[o++]=n._extrudedHeight,a[o++]=n._shadowVolume?1:0,a[o]=t.defaultValue(n._offsetAttribute,-1),a};const U=new e.Rectangle,Y=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),q={rectangle:U,ellipsoid:Y,vertexFormat:N,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};B.unpack=function(n,a,o){a=t.defaultValue(a,0);const r=e.Rectangle.unpack(n,a,U);a+=e.Rectangle.packedLength;const i=e.Ellipsoid.unpack(n,a,Y);a+=e.Ellipsoid.packedLength;const s=d.VertexFormat.unpack(n,a,N);a+=d.VertexFormat.packedLength;const l=n[a++],u=n[a++],c=n[a++],m=n[a++],p=n[a++],g=1===n[a++],y=n[a];return t.defined(o)?(o._rectangle=e.Rectangle.clone(r,o._rectangle),o._ellipsoid=e.Ellipsoid.clone(i,o._ellipsoid),o._vertexFormat=d.VertexFormat.clone(s,o._vertexFormat),o._granularity=l,o._surfaceHeight=u,o._rotation=c,o._stRotation=m,o._extrudedHeight=p,o._shadowVolume=g,o._offsetAttribute=-1===y?void 0:y,o):(q.granularity=l,q.height=u,q.rotation=c,q.stRotation=m,q.extrudedHeight=p,q.shadowVolume=g,q.offsetAttribute=-1===y?void 0:y,new B(q))},B.computeRectangle=function(n,a){const o=(n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT)).rectangle,i=t.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),s=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84);return z(o,i,t.defaultValue(n.rotation,0),s,a)};const X=new e.Matrix3,Q=new a.Quaternion,W=new e.Cartographic;B.createGeometry=function(o){if(r.CesiumMath.equalsEpsilon(o._rectangle.north,o._rectangle.south,r.CesiumMath.EPSILON10)||r.CesiumMath.equalsEpsilon(o._rectangle.east,o._rectangle.west,r.CesiumMath.EPSILON10))return;let s=o._rectangle;const l=o._ellipsoid,u=o._rotation,c=o._stRotation,d=o._vertexFormat,g=p.RectangleGeometryLibrary.computeOptions(s,o._granularity,u,c,E,k,H),y=X;if(0!==c||0!==u){const t=e.Rectangle.center(s,W),n=l.geodeticSurfaceNormalCartographic(t,L);a.Quaternion.fromAxisAngle(n,-c,Q),e.Matrix3.fromQuaternion(Q,y)}else e.Matrix3.clone(e.Matrix3.IDENTITY,y);const f=o._surfaceHeight,h=o._extrudedHeight,b=!r.CesiumMath.equalsEpsilon(f,h,0,r.CesiumMath.EPSILON2);let _,A;if(g.lonScalar=1/o._rectangle.width,g.latScalar=1/o._rectangle.height,g.tangentRotationMatrix=y,s=o._rectangle,b){_=S(o,g);const t=a.BoundingSphere.fromRectangle3D(s,l,f,P),e=a.BoundingSphere.fromRectangle3D(s,l,h,G);A=a.BoundingSphere.union(t,e)}else{if(_=M(o,g),_.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,f,l,!1),t.defined(o._offsetAttribute)){const t=_.attributes.position.values.length,e=new Uint8Array(t/3),a=o._offsetAttribute===n.GeometryOffsetAttribute.NONE?0:1;n.arrayFill(e,a),_.attributes.applyOffset=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}A=a.BoundingSphere.fromRectangle3D(s,l,f)}return d.position||delete _.attributes.position,new i.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:A,offsetAttribute:o._offsetAttribute})},B.createShadowVolume=function(t,e,n){const a=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);return new B({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};const j=new e.Rectangle,J=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],Z=new e.Matrix2,K=new e.Cartographic;return Object.defineProperties(B.prototype,{rectangle:{get:function(){return t.defined(this._rotatedRectangle)||(this._rotatedRectangle=z(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];const n=e.Rectangle.clone(t._rectangle,j),a=t._granularity,o=t._ellipsoid,r=z(n,a,t._rotation-t._stRotation,o,j),i=J;i[0].x=r.west,i[0].y=r.south,i[1].x=r.west,i[1].y=r.north,i[2].x=r.east,i[2].y=r.south;const s=t.rectangle,l=e.Matrix2.fromRotation(t._stRotation,Z),u=e.Rectangle.center(s,K);for(let t=0;t<3;++t){const n=i[t];n.x-=u.longitude,n.y-=u.latitude,e.Matrix2.multiplyByVector(l,n,n),n.x+=u.longitude,n.y+=u.latitude,n.x=(n.x-s.west)/s.width,n.y=(n.y-s.south)/s.height}const c=i[0],m=i[1],p=i[2],d=new Array(6);return e.Cartesian2.pack(c,d),e.Cartesian2.pack(m,d,2),e.Cartesian2.pack(p,d,4),d}(this)),this._textureCoordinateRotationPoints}}}),function(n,a){return t.defined(a)&&(n=B.unpack(n,a)),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),n._rectangle=e.Rectangle.clone(n._rectangle),B.createGeometry(n)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolygonPipeline-1015dc5c","./RectangleGeometryLibrary-dfe005a4","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidRhumbLine-94e77fa4"],(function(e,t,i,n,o,a,r,l,s,u,c,p,d,f,g){"use strict";const h=new n.BoundingSphere,y=new n.BoundingSphere,m=new t.Cartesian3,b=new t.Rectangle;function _(e,t){const i=e._ellipsoid,n=t.height,a=t.width,u=t.northCap,p=t.southCap;let d=n,f=2,g=0,h=4;u&&(f-=1,d-=1,g+=1,h-=2),p&&(f-=1,d-=1,g+=1,h-=2),g+=f*a+2*d-h;const y=new Float64Array(3*g);let b,_=0,E=0;const A=m;if(u)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,0,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;else for(b=0;b<a;b++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=a-1,E=1;E<n;E++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;if(E=n-1,!p)for(b=a-2;b>=0;b--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=0,E=n-2;E>0;E--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;const G=y.length/3*2,R=s.IndexDatatype.createTypedArray(y.length/3,G);let P=0;for(let e=0;e<y.length/3-1;e++)R[P++]=e,R[P++]=e+1;R[P++]=y.length/3-1,R[P++]=0;const L=new r.Geometry({attributes:new l.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});return L.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),L.indices=R,L}function E(i){const n=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).rectangle,a=e.defaultValue(i.granularity,o.CesiumMath.RADIANS_PER_DEGREE),r=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(i.rotation,0),s=e.defaultValue(i.height,0),u=e.defaultValue(i.extrudedHeight,s);this._rectangle=t.Rectangle.clone(n),this._granularity=a,this._ellipsoid=r,this._surfaceHeight=Math.max(s,u),this._rotation=l,this._extrudedHeight=Math.min(s,u),this._offsetAttribute=i.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}E.packedLength=t.Rectangle.packedLength+t.Ellipsoid.packedLength+5,E.pack=function(i,n,o){return o=e.defaultValue(o,0),t.Rectangle.pack(i._rectangle,n,o),o+=t.Rectangle.packedLength,t.Ellipsoid.pack(i._ellipsoid,n,o),o+=t.Ellipsoid.packedLength,n[o++]=i._granularity,n[o++]=i._surfaceHeight,n[o++]=i._rotation,n[o++]=i._extrudedHeight,n[o]=e.defaultValue(i._offsetAttribute,-1),n};const A=new t.Rectangle,G=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),R={rectangle:A,ellipsoid:G,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};E.unpack=function(i,n,o){n=e.defaultValue(n,0);const a=t.Rectangle.unpack(i,n,A);n+=t.Rectangle.packedLength;const r=t.Ellipsoid.unpack(i,n,G);n+=t.Ellipsoid.packedLength;const l=i[n++],s=i[n++],u=i[n++],c=i[n++],p=i[n];return e.defined(o)?(o._rectangle=t.Rectangle.clone(a,o._rectangle),o._ellipsoid=t.Ellipsoid.clone(r,o._ellipsoid),o._surfaceHeight=s,o._rotation=u,o._extrudedHeight=c,o._offsetAttribute=-1===p?void 0:p,o):(R.granularity=l,R.height=s,R.rotation=u,R.extrudedHeight=c,R.offsetAttribute=-1===p?void 0:p,new E(R))};const P=new t.Cartographic;return E.createGeometry=function(t){const a=t._rectangle,l=t._ellipsoid,p=c.RectangleGeometryLibrary.computeOptions(a,t._granularity,t._rotation,0,b,P);let d,f;if(o.CesiumMath.equalsEpsilon(a.north,a.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(a.east,a.west,o.CesiumMath.EPSILON10))return;const g=t._surfaceHeight,m=t._extrudedHeight;let E;if(!o.CesiumMath.equalsEpsilon(g,m,0,o.CesiumMath.EPSILON2)){if(d=function(e,t){const i=e._surfaceHeight,n=e._extrudedHeight,o=e._ellipsoid,a=n,r=i,l=_(e,t),c=t.height,p=t.width,d=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,o,!1);let f=d.length;const g=new Float64Array(2*f);g.set(d);const h=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,o);g.set(h,f),l.attributes.position.values=g;const y=t.northCap,m=t.southCap;let b=4;y&&(b-=1),m&&(b-=1);const E=2*(g.length/3+b),A=s.IndexDatatype.createTypedArray(g.length/3,E);f=g.length/6;let G,R=0;for(let e=0;e<f-1;e++)A[R++]=e,A[R++]=e+1,A[R++]=e+f,A[R++]=e+f+1;if(A[R++]=f-1,A[R++]=0,A[R++]=f+f-1,A[R++]=f,A[R++]=0,A[R++]=f,y)G=c-1;else{const e=p-1;A[R++]=e,A[R++]=e+f,G=p+c-2}if(A[R++]=G,A[R++]=G+f,!m){const e=p+G-1;A[R++]=e,A[R]=e+f}return l.indices=A,l}(t,p),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length/3;let n=new Uint8Array(e);t._offsetAttribute===i.GeometryOffsetAttribute.TOP?n=i.arrayFill(n,1,0,e/2):(E=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1,n=i.arrayFill(n,E)),d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}const c=n.BoundingSphere.fromRectangle3D(a,l,g,y),b=n.BoundingSphere.fromRectangle3D(a,l,m,h);f=n.BoundingSphere.union(c,b)}else{if(d=_(t,p),d.attributes.position.values=u.PolygonPipeline.scaleToGeodeticHeight(d.attributes.position.values,g,l,!1),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length,n=new Uint8Array(e/3);E=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1,i.arrayFill(n,E),d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}f=n.BoundingSphere.fromRectangle3D(a,l,g)}return new r.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:f,offsetAttribute:t._offsetAttribute})},function(i,n){return e.defined(n)&&(i=E.unpack(i,n)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),i._rectangle=t.Rectangle.clone(i._rectangle),E.createGeometry(i)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolygonPipeline-a182ab3c","./RectangleGeometryLibrary-12a48ca5","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidRhumbLine-001b8738"],(function(e,t,i,n,o,a,r,l,s,u,c,p,d,f,g){"use strict";const h=new n.BoundingSphere,y=new n.BoundingSphere,m=new t.Cartesian3,b=new t.Rectangle;function _(e,t){const i=e._ellipsoid,n=t.height,a=t.width,u=t.northCap,p=t.southCap;let d=n,f=2,g=0,h=4;u&&(f-=1,d-=1,g+=1,h-=2),p&&(f-=1,d-=1,g+=1,h-=2),g+=f*a+2*d-h;const y=new Float64Array(3*g);let b,_=0,E=0;const A=m;if(u)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,0,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;else for(b=0;b<a;b++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=a-1,E=1;E<n;E++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;if(E=n-1,!p)for(b=a-2;b>=0;b--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=0,E=n-2;E>0;E--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;const G=y.length/3*2,R=s.IndexDatatype.createTypedArray(y.length/3,G);let P=0;for(let e=0;e<y.length/3-1;e++)R[P++]=e,R[P++]=e+1;R[P++]=y.length/3-1,R[P++]=0;const L=new r.Geometry({attributes:new l.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});return L.attributes.position=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),L.indices=R,L}function E(i){const n=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).rectangle,a=e.defaultValue(i.granularity,o.CesiumMath.RADIANS_PER_DEGREE),r=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(i.rotation,0),s=e.defaultValue(i.height,0),u=e.defaultValue(i.extrudedHeight,s);this._rectangle=t.Rectangle.clone(n),this._granularity=a,this._ellipsoid=r,this._surfaceHeight=Math.max(s,u),this._rotation=l,this._extrudedHeight=Math.min(s,u),this._offsetAttribute=i.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}E.packedLength=t.Rectangle.packedLength+t.Ellipsoid.packedLength+5,E.pack=function(i,n,o){return o=e.defaultValue(o,0),t.Rectangle.pack(i._rectangle,n,o),o+=t.Rectangle.packedLength,t.Ellipsoid.pack(i._ellipsoid,n,o),o+=t.Ellipsoid.packedLength,n[o++]=i._granularity,n[o++]=i._surfaceHeight,n[o++]=i._rotation,n[o++]=i._extrudedHeight,n[o]=e.defaultValue(i._offsetAttribute,-1),n};const A=new t.Rectangle,G=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),R={rectangle:A,ellipsoid:G,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};E.unpack=function(i,n,o){n=e.defaultValue(n,0);const a=t.Rectangle.unpack(i,n,A);n+=t.Rectangle.packedLength;const r=t.Ellipsoid.unpack(i,n,G);n+=t.Ellipsoid.packedLength;const l=i[n++],s=i[n++],u=i[n++],c=i[n++],p=i[n];return e.defined(o)?(o._rectangle=t.Rectangle.clone(a,o._rectangle),o._ellipsoid=t.Ellipsoid.clone(r,o._ellipsoid),o._surfaceHeight=s,o._rotation=u,o._extrudedHeight=c,o._offsetAttribute=-1===p?void 0:p,o):(R.granularity=l,R.height=s,R.rotation=u,R.extrudedHeight=c,R.offsetAttribute=-1===p?void 0:p,new E(R))};const P=new t.Cartographic;return E.createGeometry=function(t){const a=t._rectangle,l=t._ellipsoid,p=c.RectangleGeometryLibrary.computeOptions(a,t._granularity,t._rotation,0,b,P);let d,f;if(o.CesiumMath.equalsEpsilon(a.north,a.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(a.east,a.west,o.CesiumMath.EPSILON10))return;const g=t._surfaceHeight,m=t._extrudedHeight;let E;if(!o.CesiumMath.equalsEpsilon(g,m,0,o.CesiumMath.EPSILON2)){if(d=function(e,t){const i=e._surfaceHeight,n=e._extrudedHeight,o=e._ellipsoid,a=n,r=i,l=_(e,t),c=t.height,p=t.width,d=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,o,!1);let f=d.length;const g=new Float64Array(2*f);g.set(d);const h=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,o);g.set(h,f),l.attributes.position.values=g;const y=t.northCap,m=t.southCap;let b=4;y&&(b-=1),m&&(b-=1);const E=2*(g.length/3+b),A=s.IndexDatatype.createTypedArray(g.length/3,E);f=g.length/6;let G,R=0;for(let e=0;e<f-1;e++)A[R++]=e,A[R++]=e+1,A[R++]=e+f,A[R++]=e+f+1;if(A[R++]=f-1,A[R++]=0,A[R++]=f+f-1,A[R++]=f,A[R++]=0,A[R++]=f,y)G=c-1;else{const e=p-1;A[R++]=e,A[R++]=e+f,G=p+c-2}if(A[R++]=G,A[R++]=G+f,!m){const e=p+G-1;A[R++]=e,A[R]=e+f}return l.indices=A,l}(t,p),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length/3;let n=new Uint8Array(e);t._offsetAttribute===i.GeometryOffsetAttribute.TOP?n=i.arrayFill(n,1,0,e/2):(E=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1,n=i.arrayFill(n,E)),d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}const c=n.BoundingSphere.fromRectangle3D(a,l,g,y),b=n.BoundingSphere.fromRectangle3D(a,l,m,h);f=n.BoundingSphere.union(c,b)}else{if(d=_(t,p),d.attributes.position.values=u.PolygonPipeline.scaleToGeodeticHeight(d.attributes.position.values,g,l,!1),e.defined(t._offsetAttribute)){const e=d.attributes.position.values.length,n=new Uint8Array(e/3);E=t._offsetAttribute===i.GeometryOffsetAttribute.NONE?0:1,i.arrayFill(n,E),d.attributes.applyOffset=new r.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}f=n.BoundingSphere.fromRectangle3D(a,l,g)}return new r.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:f,offsetAttribute:t._offsetAttribute})},function(i,n){return e.defined(n)&&(i=E.unpack(i,n)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),i._rectangle=t.Rectangle.clone(i._rectangle),E.createGeometry(i)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./ArcType-e1641d8d","./Transforms-06c05e21","./Color-451a8720","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./PolylinePipeline-256ec228","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,o,t,l,r,n,i,a,s,c,p,d,f,y,u,h,C,m){"use strict";function T(e,o,t,l,n,i,a){const s=p.PolylinePipeline.numberOfPoints(e,o,n);let c;const d=t.red,f=t.green,y=t.blue,u=t.alpha,h=l.red,C=l.green,m=l.blue,T=l.alpha;if(r.Color.equals(t,l)){for(c=0;c<s;c++)i[a++]=r.Color.floatToByte(d),i[a++]=r.Color.floatToByte(f),i[a++]=r.Color.floatToByte(y),i[a++]=r.Color.floatToByte(u);return a}const g=(h-d)/s,_=(C-f)/s,P=(m-y)/s,b=(T-u)/s;let B=a;for(c=0;c<s;c++)i[B++]=r.Color.floatToByte(d+c*g),i[B++]=r.Color.floatToByte(f+c*_),i[B++]=r.Color.floatToByte(y+c*P),i[B++]=r.Color.floatToByte(u+c*b);return B}function g(l){const i=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,a=l.colors,s=e.defaultValue(l.colorsPerVertex,!1);this._positions=i,this._colors=a,this._colorsPerVertex=s,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let c=1+i.length*o.Cartesian3.packedLength;c+=e.defined(a)?1+a.length*r.Color.packedLength:1,this.packedLength=c+o.Ellipsoid.packedLength+3}g.pack=function(t,l,n){let i;n=e.defaultValue(n,0);const a=t._positions;let s=a.length;for(l[n++]=s,i=0;i<s;++i,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(a[i],l,n);const c=t._colors;for(s=e.defined(c)?c.length:0,l[n++]=s,i=0;i<s;++i,n+=r.Color.packedLength)r.Color.pack(c[i],l,n);return o.Ellipsoid.pack(t._ellipsoid,l,n),n+=o.Ellipsoid.packedLength,l[n++]=t._colorsPerVertex?1:0,l[n++]=t._arcType,l[n]=t._granularity,l},g.unpack=function(t,l,n){let i;l=e.defaultValue(l,0);let a=t[l++];const s=new Array(a);for(i=0;i<a;++i,l+=o.Cartesian3.packedLength)s[i]=o.Cartesian3.unpack(t,l);a=t[l++];const c=a>0?new Array(a):void 0;for(i=0;i<a;++i,l+=r.Color.packedLength)c[i]=r.Color.unpack(t,l);const p=o.Ellipsoid.unpack(t,l);l+=o.Ellipsoid.packedLength;const d=1===t[l++],f=t[l++],y=t[l];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=p,n._colorsPerVertex=d,n._arcType=f,n._granularity=y,n):new g({positions:s,colors:c,ellipsoid:p,colorsPerVertex:d,arcType:f,granularity:y})};const _=new Array(2),P=new Array(2),b={positions:_,height:P,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return g.createGeometry=function(i){const d=i._positions,f=i._colors,y=i._colorsPerVertex,u=i._arcType,h=i._granularity,C=i._ellipsoid,m=n.CesiumMath.chordLength(h,C.maximumRadius),g=e.defined(f)&&!y;let B;const A=d.length;let E,k,G,D,L=0;if(u===t.ArcType.GEODESIC||u===t.ArcType.RHUMB){let o,l,i;u===t.ArcType.GEODESIC?(o=n.CesiumMath.chordLength(h,C.maximumRadius),l=p.PolylinePipeline.numberOfPoints,i=p.PolylinePipeline.generateArc):(o=h,l=p.PolylinePipeline.numberOfPointsRhumbLine,i=p.PolylinePipeline.generateRhumbArc);const a=p.PolylinePipeline.extractHeights(d,C),s=b;if(u===t.ArcType.GEODESIC?s.minDistance=m:s.granularity=h,s.ellipsoid=C,g){let t=0;for(B=0;B<A-1;B++)t+=l(d[B],d[B+1],o)+1;E=new Float64Array(3*t),G=new Uint8Array(4*t),s.positions=_,s.height=P;let n=0;for(B=0;B<A-1;++B){_[0]=d[B],_[1]=d[B+1],P[0]=a[B],P[1]=a[B+1];const o=i(s);if(e.defined(f)){const e=o.length/3;D=f[B];for(let o=0;o<e;++o)G[n++]=r.Color.floatToByte(D.red),G[n++]=r.Color.floatToByte(D.green),G[n++]=r.Color.floatToByte(D.blue),G[n++]=r.Color.floatToByte(D.alpha)}E.set(o,L),L+=o.length}}else if(s.positions=d,s.height=a,E=new Float64Array(i(s)),e.defined(f)){for(G=new Uint8Array(E.length/3*4),B=0;B<A-1;++B){L=T(d[B],d[B+1],f[B],f[B+1],m,G,L)}const e=f[A-1];G[L++]=r.Color.floatToByte(e.red),G[L++]=r.Color.floatToByte(e.green),G[L++]=r.Color.floatToByte(e.blue),G[L++]=r.Color.floatToByte(e.alpha)}}else{k=g?2*A-2:A,E=new Float64Array(3*k),G=e.defined(f)?new Uint8Array(4*k):void 0;let t=0,l=0;for(B=0;B<A;++B){const n=d[B];if(g&&B>0&&(o.Cartesian3.pack(n,E,t),t+=3,D=f[B-1],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha)),g&&B===A-1)break;o.Cartesian3.pack(n,E,t),t+=3,e.defined(f)&&(D=f[B],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha))}}const w=new s.GeometryAttributes;w.position=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:E}),e.defined(f)&&(w.color=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0})),k=E.length/3;const V=2*(k-1),x=c.IndexDatatype.createTypedArray(k,V);let S=0;for(B=0;B<k-1;++B)x[S++]=B,x[S++]=B+1;return new a.Geometry({attributes:w,indices:x,primitiveType:a.PrimitiveType.LINES,boundingSphere:l.BoundingSphere.fromPoints(d)})},function(t,l){return e.defined(l)&&(t=g.unpack(t,l)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),g.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./ArcType-e1641d8d","./Transforms-fdc0a95d","./Color-12d5ab6e","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./PolylinePipeline-4f5c4291","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,o,t,l,r,n,i,a,s,c,p,d,f,y,u,h,C,m){"use strict";function T(e,o,t,l,n,i,a){const s=p.PolylinePipeline.numberOfPoints(e,o,n);let c;const d=t.red,f=t.green,y=t.blue,u=t.alpha,h=l.red,C=l.green,m=l.blue,T=l.alpha;if(r.Color.equals(t,l)){for(c=0;c<s;c++)i[a++]=r.Color.floatToByte(d),i[a++]=r.Color.floatToByte(f),i[a++]=r.Color.floatToByte(y),i[a++]=r.Color.floatToByte(u);return a}const g=(h-d)/s,b=(C-f)/s,_=(m-y)/s,P=(T-u)/s;let B=a;for(c=0;c<s;c++)i[B++]=r.Color.floatToByte(d+c*g),i[B++]=r.Color.floatToByte(f+c*b),i[B++]=r.Color.floatToByte(y+c*_),i[B++]=r.Color.floatToByte(u+c*P);return B}function g(l){const i=(l=e.defaultValue(l,e.defaultValue.EMPTY_OBJECT)).positions,a=l.colors,s=e.defaultValue(l.colorsPerVertex,!1);this._positions=i,this._colors=a,this._colorsPerVertex=s,this._arcType=e.defaultValue(l.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(l.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(l.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";let c=1+i.length*o.Cartesian3.packedLength;c+=e.defined(a)?1+a.length*r.Color.packedLength:1,this.packedLength=c+o.Ellipsoid.packedLength+3}g.pack=function(t,l,n){let i;n=e.defaultValue(n,0);const a=t._positions;let s=a.length;for(l[n++]=s,i=0;i<s;++i,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(a[i],l,n);const c=t._colors;for(s=e.defined(c)?c.length:0,l[n++]=s,i=0;i<s;++i,n+=r.Color.packedLength)r.Color.pack(c[i],l,n);return o.Ellipsoid.pack(t._ellipsoid,l,n),n+=o.Ellipsoid.packedLength,l[n++]=t._colorsPerVertex?1:0,l[n++]=t._arcType,l[n]=t._granularity,l},g.unpack=function(t,l,n){let i;l=e.defaultValue(l,0);let a=t[l++];const s=new Array(a);for(i=0;i<a;++i,l+=o.Cartesian3.packedLength)s[i]=o.Cartesian3.unpack(t,l);a=t[l++];const c=a>0?new Array(a):void 0;for(i=0;i<a;++i,l+=r.Color.packedLength)c[i]=r.Color.unpack(t,l);const p=o.Ellipsoid.unpack(t,l);l+=o.Ellipsoid.packedLength;const d=1===t[l++],f=t[l++],y=t[l];return e.defined(n)?(n._positions=s,n._colors=c,n._ellipsoid=p,n._colorsPerVertex=d,n._arcType=f,n._granularity=y,n):new g({positions:s,colors:c,ellipsoid:p,colorsPerVertex:d,arcType:f,granularity:y})};const b=new Array(2),_=new Array(2),P={positions:b,height:_,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return g.createGeometry=function(i){const d=i._positions,f=i._colors,y=i._colorsPerVertex,u=i._arcType,h=i._granularity,C=i._ellipsoid,m=n.CesiumMath.chordLength(h,C.maximumRadius),g=e.defined(f)&&!y;let B;const A=d.length;let E,k,G,D,L=0;if(u===t.ArcType.GEODESIC||u===t.ArcType.RHUMB){let o,l,i;u===t.ArcType.GEODESIC?(o=n.CesiumMath.chordLength(h,C.maximumRadius),l=p.PolylinePipeline.numberOfPoints,i=p.PolylinePipeline.generateArc):(o=h,l=p.PolylinePipeline.numberOfPointsRhumbLine,i=p.PolylinePipeline.generateRhumbArc);const a=p.PolylinePipeline.extractHeights(d,C),s=P;if(u===t.ArcType.GEODESIC?s.minDistance=m:s.granularity=h,s.ellipsoid=C,g){let t=0;for(B=0;B<A-1;B++)t+=l(d[B],d[B+1],o)+1;E=new Float64Array(3*t),G=new Uint8Array(4*t),s.positions=b,s.height=_;let n=0;for(B=0;B<A-1;++B){b[0]=d[B],b[1]=d[B+1],_[0]=a[B],_[1]=a[B+1];const o=i(s);if(e.defined(f)){const e=o.length/3;D=f[B];for(let o=0;o<e;++o)G[n++]=r.Color.floatToByte(D.red),G[n++]=r.Color.floatToByte(D.green),G[n++]=r.Color.floatToByte(D.blue),G[n++]=r.Color.floatToByte(D.alpha)}E.set(o,L),L+=o.length}}else if(s.positions=d,s.height=a,E=new Float64Array(i(s)),e.defined(f)){for(G=new Uint8Array(E.length/3*4),B=0;B<A-1;++B){L=T(d[B],d[B+1],f[B],f[B+1],m,G,L)}const e=f[A-1];G[L++]=r.Color.floatToByte(e.red),G[L++]=r.Color.floatToByte(e.green),G[L++]=r.Color.floatToByte(e.blue),G[L++]=r.Color.floatToByte(e.alpha)}}else{k=g?2*A-2:A,E=new Float64Array(3*k),G=e.defined(f)?new Uint8Array(4*k):void 0;let t=0,l=0;for(B=0;B<A;++B){const n=d[B];if(g&&B>0&&(o.Cartesian3.pack(n,E,t),t+=3,D=f[B-1],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha)),g&&B===A-1)break;o.Cartesian3.pack(n,E,t),t+=3,e.defined(f)&&(D=f[B],G[l++]=r.Color.floatToByte(D.red),G[l++]=r.Color.floatToByte(D.green),G[l++]=r.Color.floatToByte(D.blue),G[l++]=r.Color.floatToByte(D.alpha))}}const w=new s.GeometryAttributes;w.position=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:E}),e.defined(f)&&(w.color=new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0})),k=E.length/3;const V=2*(k-1),x=c.IndexDatatype.createTypedArray(k,V);let S=0;for(B=0;B<k-1;++B)x[S++]=B,x[S++]=B+1;return new a.Geometry({attributes:w,indices:x,primitiveType:a.PrimitiveType.LINES,boundingSphere:l.BoundingSphere.fromPoints(d)})},function(t,l){return e.defined(l)&&(t=g.unpack(t,l)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),g.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./EllipsoidGeometry-418f414a","./VertexFormat-e68722dd","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622"],(function(e,t,i,r,o,a,n,s,c,d,l,m,u,p){"use strict";function f(i){const o=e.defaultValue(i.radius,1),a={radii:new t.Cartesian3(o,o,o),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r.EllipsoidGeometry(a),this._workerName="createSphereGeometry"}f.packedLength=r.EllipsoidGeometry.packedLength,f.pack=function(e,t,i){return r.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,i)};const y=new r.EllipsoidGeometry,G={radius:void 0,radii:new t.Cartesian3,vertexFormat:new o.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(i,a,n){const s=r.EllipsoidGeometry.unpack(i,a,y);return G.vertexFormat=o.VertexFormat.clone(s._vertexFormat,G.vertexFormat),G.stackPartitions=s._stackPartitions,G.slicePartitions=s._slicePartitions,e.defined(n)?(t.Cartesian3.clone(s._radii,G.radii),n._ellipsoidGeometry=new r.EllipsoidGeometry(G),n):(G.radius=s._radii.x,new f(G))},f.createGeometry=function(e){return r.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(t,i){return e.defined(i)&&(t=f.unpack(t,i)),f.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./EllipsoidGeometry-591d0b9b","./VertexFormat-e68722dd","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb"],(function(e,t,i,r,o,a,n,s,d,c,l,m,u,p){"use strict";function f(i){const o=e.defaultValue(i.radius,1),a={radii:new t.Cartesian3(o,o,o),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r.EllipsoidGeometry(a),this._workerName="createSphereGeometry"}f.packedLength=r.EllipsoidGeometry.packedLength,f.pack=function(e,t,i){return r.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,i)};const y=new r.EllipsoidGeometry,G={radius:void 0,radii:new t.Cartesian3,vertexFormat:new o.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(i,a,n){const s=r.EllipsoidGeometry.unpack(i,a,y);return G.vertexFormat=o.VertexFormat.clone(s._vertexFormat,G.vertexFormat),G.stackPartitions=s._stackPartitions,G.slicePartitions=s._slicePartitions,e.defined(n)?(t.Cartesian3.clone(s._radii,G.radii),n._ellipsoidGeometry=new r.EllipsoidGeometry(G),n):(G.radius=s._radii.x,new f(G))},f.createGeometry=function(e){return r.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(t,i){return e.defined(i)&&(t=f.unpack(t,i)),f.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./RuntimeError-ac440aa5","./EllipsoidOutlineGeometry-1081cab8","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622"],(function(e,i,t,n,o,r,s,a,l,c,d,u,m){"use strict";function p(t){const o=e.defaultValue(t.radius,1),r={radii:new i.Cartesian3(o,o,o),stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(r),this._workerName="createSphereOutlineGeometry"}p.packedLength=n.EllipsoidOutlineGeometry.packedLength,p.pack=function(e,i,t){return n.EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,i,t)};const y=new n.EllipsoidOutlineGeometry,f={radius:void 0,radii:new i.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(t,o,r){const s=n.EllipsoidOutlineGeometry.unpack(t,o,y);return f.stackPartitions=s._stackPartitions,f.slicePartitions=s._slicePartitions,f.subdivisions=s._subdivisions,e.defined(r)?(i.Cartesian3.clone(s._radii,f.radii),r._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(f),r):(f.radius=s._radii.x,new p(f))},p.createGeometry=function(e){return n.EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},function(i,t){return e.defined(t)&&(i=p.unpack(i,t)),p.createGeometry(i)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./RuntimeError-ac440aa5","./EllipsoidOutlineGeometry-08ca8d96","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./GeometryOffsetAttribute-4d39b441","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb"],(function(e,i,t,n,o,r,s,a,d,l,u,c,m){"use strict";function p(t){const o=e.defaultValue(t.radius,1),r={radii:new i.Cartesian3(o,o,o),stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(r),this._workerName="createSphereOutlineGeometry"}p.packedLength=n.EllipsoidOutlineGeometry.packedLength,p.pack=function(e,i,t){return n.EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,i,t)};const f=new n.EllipsoidOutlineGeometry,y={radius:void 0,radii:new i.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(t,o,r){const s=n.EllipsoidOutlineGeometry.unpack(t,o,f);return y.stackPartitions=s._stackPartitions,y.slicePartitions=s._slicePartitions,y.subdivisions=s._subdivisions,e.defined(r)?(i.Cartesian3.clone(s._radii,y.radii),r._ellipsoidGeometry=new n.EllipsoidOutlineGeometry(y),r):(y.radius=s._radii.x,new p(y))},p.createGeometry=function(e){return n.EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},function(i,t){return e.defined(t)&&(i=p.unpack(i,t)),p.createGeometry(i)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./AttributeCompression-6e71d14f","./Matrix2-e6265fb0","./combine-0259f56f","./IndexDatatype-1cbc8622","./ComponentDatatype-a9820060","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(t,e,a,s,n,r,i,o,c){"use strict";const l=32767,d=Math.cos(n.CesiumMath.toRadians(150)),f=new e.Cartographic,u=new e.Cartesian3;const h=new e.Cartographic,C=new e.Cartographic;function p(t){const e=8*t,a=3*e,n=4*e;this.startEllipsoidNormals=new Float32Array(a),this.endEllipsoidNormals=new Float32Array(a),this.startPositionAndHeights=new Float32Array(n),this.startFaceNormalAndVertexCornerIds=new Float32Array(n),this.endPositionAndHeights=new Float32Array(n),this.endFaceNormalAndHalfWidths=new Float32Array(n),this.vertexBatchIds=new Uint16Array(e),this.indices=s.IndexDatatype.createTypedArray(e,36*t),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}const m=new e.Cartesian3,b=new e.Cartesian3;function A(t,a,s,n,r){const i=e.Cartesian3.subtract(s,a,b);let o=e.Cartesian3.subtract(a,t,m);return e.Cartesian3.normalize(i,i),e.Cartesian3.normalize(o,o),e.Cartesian3.dot(i,o)<d&&(o=e.Cartesian3.multiplyByScalar(o,-1,m)),e.Cartesian3.add(i,o,r),e.Cartesian3.equals(r,e.Cartesian3.ZERO)&&(r=e.Cartesian3.subtract(t,a)),e.Cartesian3.cross(r,n,r),e.Cartesian3.cross(n,r,r),e.Cartesian3.normalize(r,r),r}const w=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],g=w.length,y=new e.Cartesian3,N=new e.Cartesian3,k=new e.Cartesian3,I=new e.Cartesian3,x=new e.Cartesian3;p.prototype.addVolume=function(t,a,s,n,r,i,o,c,l,d){let f=e.Cartesian3.add(a,l,y);const u=d.geodeticSurfaceNormal(f,N);f=e.Cartesian3.add(s,l,y);const h=d.geodeticSurfaceNormal(f,I),C=A(t,a,s,u,k),p=A(n,s,a,h,x),m=this.startEllipsoidNormals,b=this.endEllipsoidNormals,E=this.startPositionAndHeights,F=this.startFaceNormalAndVertexCornerIds,H=this.endPositionAndHeights,O=this.endFaceNormalAndHalfWidths,P=this.vertexBatchIds;let v,D=this.batchIdOffset,S=this.vec3Offset,M=this.vec4Offset;for(v=0;v<8;v++)e.Cartesian3.pack(u,m,S),e.Cartesian3.pack(h,b,S),e.Cartesian3.pack(a,E,M),E[M+3]=r,e.Cartesian3.pack(s,H,M),H[M+3]=i,e.Cartesian3.pack(C,F,M),F[M+3]=v,e.Cartesian3.pack(p,O,M),O[M+3]=o,P[D++]=c,S+=3,M+=4;this.batchIdOffset=D,this.vec3Offset=S,this.vec4Offset=M;const R=this.indices,U=this.volumeStartIndex,B=this.indexOffset;for(v=0;v<g;v++)R[B+v]=w[v]+U;this.volumeStartIndex+=8,this.indexOffset+=g};const E=new e.Rectangle,F=new e.Ellipsoid,H=new e.Cartesian3,O=new e.Cartesian3,P=new e.Cartesian3,v=new e.Cartesian3,D=new e.Cartesian3;return r((function(r,i){const o=new Uint16Array(r.positions),c=new Uint16Array(r.widths),d=new Uint32Array(r.counts),m=new Uint16Array(r.batchIds),b=E,A=F,w=H,g=new Float64Array(r.packedBuffer);let y=0;const N=g[y++],k=g[y++];let I;e.Rectangle.unpack(g,y,b),y+=e.Rectangle.packedLength,e.Ellipsoid.unpack(g,y,A),y+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(g,y,w);let x=o.length/3;const S=o.subarray(0,x),M=o.subarray(x,2*x),R=o.subarray(2*x,3*x);t.AttributeCompression.zigZagDeltaDecode(S,M,R),function(t,a,s,n){const r=n.length,i=t.length,o=new Uint8Array(i),c=h,l=C;let d=0;for(let s=0;s<r;s++){const r=n[s];let i=r;for(let s=1;s<r;s++){const n=d+s,r=n-1;l.longitude=t[n],l.latitude=a[n],c.longitude=t[r],c.latitude=a[r],e.Cartographic.equals(l,c)&&(i--,o[r]=1)}n[s]=i,d+=r}let f=0;for(let e=0;e<i;e++)1!==o[e]&&(t[f]=t[e],a[f]=a[e],s[f]=s[e],f++)}(S,M,R,d);const U=d.length;let B=0;for(I=0;I<U;I++){B+=d[I]-1}const V=new p(B),T=function(t,a,s,r,i,o,c){const d=t.length,h=new Float64Array(3*d);for(let C=0;C<d;++C){const d=t[C],p=a[C],m=s[C],b=n.CesiumMath.lerp(r.west,r.east,d/l),A=n.CesiumMath.lerp(r.south,r.north,p/l),w=n.CesiumMath.lerp(i,o,m/l),g=e.Cartographic.fromRadians(b,A,w,f),y=c.cartographicToCartesian(g,u);e.Cartesian3.pack(y,h,3*C)}return h}(S,M,R,b,N,k,A);x=S.length;const W=new Float32Array(3*x);for(I=0;I<x;++I)W[3*I]=T[3*I]-w.x,W[3*I+1]=T[3*I+1]-w.y,W[3*I+2]=T[3*I+2]-w.z;let z=0,q=0;for(I=0;I<U;I++){const t=d[I]-1,a=.5*c[I],s=m[I],r=z;for(let i=0;i<t;i++){const o=e.Cartesian3.unpack(W,z,P),c=e.Cartesian3.unpack(W,z+3,v);let d=R[q],f=R[q+1];d=n.CesiumMath.lerp(N,k,d/l),f=n.CesiumMath.lerp(N,k,f/l),q++;let u=O,h=D;if(0===i){const a=r+3*t,s=e.Cartesian3.unpack(W,a,O);if(e.Cartesian3.equals(s,o))e.Cartesian3.unpack(W,a-3,u);else{const t=e.Cartesian3.subtract(o,c,O);u=e.Cartesian3.add(t,o,O)}}else e.Cartesian3.unpack(W,z-3,u);if(i===t-1){const t=e.Cartesian3.unpack(W,r,D);if(e.Cartesian3.equals(t,c))e.Cartesian3.unpack(W,r+3,h);else{const t=e.Cartesian3.subtract(c,o,D);h=e.Cartesian3.add(t,c,D)}}else e.Cartesian3.unpack(W,z+6,h);V.addVolume(u,o,c,h,d,f,a,s,w,A),z+=3}z+=3,q++}const L=V.indices;i.push(V.startEllipsoidNormals.buffer),i.push(V.endEllipsoidNormals.buffer),i.push(V.startPositionAndHeights.buffer),i.push(V.startFaceNormalAndVertexCornerIds.buffer),i.push(V.endPositionAndHeights.buffer),i.push(V.endFaceNormalAndHalfWidths.buffer),i.push(V.vertexBatchIds.buffer),i.push(L.buffer);let _={indexDatatype:2===L.BYTES_PER_ELEMENT?s.IndexDatatype.UNSIGNED_SHORT:s.IndexDatatype.UNSIGNED_INT,startEllipsoidNormals:V.startEllipsoidNormals.buffer,endEllipsoidNormals:V.endEllipsoidNormals.buffer,startPositionAndHeights:V.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:V.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:V.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:V.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:V.vertexBatchIds.buffer,indices:L.buffer};if(r.keepDecodedPositions){const t=function(t){const e=t.length,a=new Uint32Array(e+1);let s=0;for(let n=0;n<e;++n)a[n]=s,s+=t[n];return a[e]=s,a}(d);i.push(T.buffer,t.buffer),_=a.combine(_,{decodedPositions:T.buffer,decodedPositionOffsets:t.buffer})}return _}))})); | ||
define(["./AttributeCompression-4c4a8822","./Matrix2-1ba2543c","./combine-0259f56f","./IndexDatatype-0b020dfb","./ComponentDatatype-07fbb0d4","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(t,e,a,s,n,r,i,o,c){"use strict";const l=32767,d=Math.cos(n.CesiumMath.toRadians(150)),f=new e.Cartographic,u=new e.Cartesian3;const h=new e.Cartographic,C=new e.Cartographic;function p(t){const e=8*t,a=3*e,n=4*e;this.startEllipsoidNormals=new Float32Array(a),this.endEllipsoidNormals=new Float32Array(a),this.startPositionAndHeights=new Float32Array(n),this.startFaceNormalAndVertexCornerIds=new Float32Array(n),this.endPositionAndHeights=new Float32Array(n),this.endFaceNormalAndHalfWidths=new Float32Array(n),this.vertexBatchIds=new Uint16Array(e),this.indices=s.IndexDatatype.createTypedArray(e,36*t),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}const m=new e.Cartesian3,b=new e.Cartesian3;function A(t,a,s,n,r){const i=e.Cartesian3.subtract(s,a,b);let o=e.Cartesian3.subtract(a,t,m);return e.Cartesian3.normalize(i,i),e.Cartesian3.normalize(o,o),e.Cartesian3.dot(i,o)<d&&(o=e.Cartesian3.multiplyByScalar(o,-1,m)),e.Cartesian3.add(i,o,r),e.Cartesian3.equals(r,e.Cartesian3.ZERO)&&(r=e.Cartesian3.subtract(t,a)),e.Cartesian3.cross(r,n,r),e.Cartesian3.cross(n,r,r),e.Cartesian3.normalize(r,r),r}const w=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],g=w.length,y=new e.Cartesian3,N=new e.Cartesian3,k=new e.Cartesian3,I=new e.Cartesian3,x=new e.Cartesian3;p.prototype.addVolume=function(t,a,s,n,r,i,o,c,l,d){let f=e.Cartesian3.add(a,l,y);const u=d.geodeticSurfaceNormal(f,N);f=e.Cartesian3.add(s,l,y);const h=d.geodeticSurfaceNormal(f,I),C=A(t,a,s,u,k),p=A(n,s,a,h,x),m=this.startEllipsoidNormals,b=this.endEllipsoidNormals,E=this.startPositionAndHeights,F=this.startFaceNormalAndVertexCornerIds,H=this.endPositionAndHeights,O=this.endFaceNormalAndHalfWidths,P=this.vertexBatchIds;let v,D=this.batchIdOffset,S=this.vec3Offset,M=this.vec4Offset;for(v=0;v<8;v++)e.Cartesian3.pack(u,m,S),e.Cartesian3.pack(h,b,S),e.Cartesian3.pack(a,E,M),E[M+3]=r,e.Cartesian3.pack(s,H,M),H[M+3]=i,e.Cartesian3.pack(C,F,M),F[M+3]=v,e.Cartesian3.pack(p,O,M),O[M+3]=o,P[D++]=c,S+=3,M+=4;this.batchIdOffset=D,this.vec3Offset=S,this.vec4Offset=M;const R=this.indices,U=this.volumeStartIndex,B=this.indexOffset;for(v=0;v<g;v++)R[B+v]=w[v]+U;this.volumeStartIndex+=8,this.indexOffset+=g};const E=new e.Rectangle,F=new e.Ellipsoid,H=new e.Cartesian3,O=new e.Cartesian3,P=new e.Cartesian3,v=new e.Cartesian3,D=new e.Cartesian3;return r((function(r,i){const o=new Uint16Array(r.positions),c=new Uint16Array(r.widths),d=new Uint32Array(r.counts),m=new Uint16Array(r.batchIds),b=E,A=F,w=H,g=new Float64Array(r.packedBuffer);let y=0;const N=g[y++],k=g[y++];let I;e.Rectangle.unpack(g,y,b),y+=e.Rectangle.packedLength,e.Ellipsoid.unpack(g,y,A),y+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(g,y,w);let x=o.length/3;const S=o.subarray(0,x),M=o.subarray(x,2*x),R=o.subarray(2*x,3*x);t.AttributeCompression.zigZagDeltaDecode(S,M,R),function(t,a,s,n){const r=n.length,i=t.length,o=new Uint8Array(i),c=h,l=C;let d=0;for(let s=0;s<r;s++){const r=n[s];let i=r;for(let s=1;s<r;s++){const n=d+s,r=n-1;l.longitude=t[n],l.latitude=a[n],c.longitude=t[r],c.latitude=a[r],e.Cartographic.equals(l,c)&&(i--,o[r]=1)}n[s]=i,d+=r}let f=0;for(let e=0;e<i;e++)1!==o[e]&&(t[f]=t[e],a[f]=a[e],s[f]=s[e],f++)}(S,M,R,d);const U=d.length;let B=0;for(I=0;I<U;I++){B+=d[I]-1}const V=new p(B),T=function(t,a,s,r,i,o,c){const d=t.length,h=new Float64Array(3*d);for(let C=0;C<d;++C){const d=t[C],p=a[C],m=s[C],b=n.CesiumMath.lerp(r.west,r.east,d/l),A=n.CesiumMath.lerp(r.south,r.north,p/l),w=n.CesiumMath.lerp(i,o,m/l),g=e.Cartographic.fromRadians(b,A,w,f),y=c.cartographicToCartesian(g,u);e.Cartesian3.pack(y,h,3*C)}return h}(S,M,R,b,N,k,A);x=S.length;const W=new Float32Array(3*x);for(I=0;I<x;++I)W[3*I]=T[3*I]-w.x,W[3*I+1]=T[3*I+1]-w.y,W[3*I+2]=T[3*I+2]-w.z;let z=0,q=0;for(I=0;I<U;I++){const t=d[I]-1,a=.5*c[I],s=m[I],r=z;for(let i=0;i<t;i++){const o=e.Cartesian3.unpack(W,z,P),c=e.Cartesian3.unpack(W,z+3,v);let d=R[q],f=R[q+1];d=n.CesiumMath.lerp(N,k,d/l),f=n.CesiumMath.lerp(N,k,f/l),q++;let u=O,h=D;if(0===i){const a=r+3*t,s=e.Cartesian3.unpack(W,a,O);if(e.Cartesian3.equals(s,o))e.Cartesian3.unpack(W,a-3,u);else{const t=e.Cartesian3.subtract(o,c,O);u=e.Cartesian3.add(t,o,O)}}else e.Cartesian3.unpack(W,z-3,u);if(i===t-1){const t=e.Cartesian3.unpack(W,r,D);if(e.Cartesian3.equals(t,c))e.Cartesian3.unpack(W,r+3,h);else{const t=e.Cartesian3.subtract(c,o,D);h=e.Cartesian3.add(t,c,D)}}else e.Cartesian3.unpack(W,z+6,h);V.addVolume(u,o,c,h,d,f,a,s,w,A),z+=3}z+=3,q++}const L=V.indices;i.push(V.startEllipsoidNormals.buffer),i.push(V.endEllipsoidNormals.buffer),i.push(V.startPositionAndHeights.buffer),i.push(V.startFaceNormalAndVertexCornerIds.buffer),i.push(V.endPositionAndHeights.buffer),i.push(V.endFaceNormalAndHalfWidths.buffer),i.push(V.vertexBatchIds.buffer),i.push(L.buffer);let _={indexDatatype:2===L.BYTES_PER_ELEMENT?s.IndexDatatype.UNSIGNED_SHORT:s.IndexDatatype.UNSIGNED_INT,startEllipsoidNormals:V.startEllipsoidNormals.buffer,endEllipsoidNormals:V.endEllipsoidNormals.buffer,startPositionAndHeights:V.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:V.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:V.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:V.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:V.vertexBatchIds.buffer,indices:L.buffer};if(r.keepDecodedPositions){const t=function(t){const e=t.length,a=new Uint32Array(e+1);let s=0;for(let n=0;n<e;++n)a[n]=s,s+=t[n];return a[e]=s,a}(d);i.push(T.buffer,t.buffer),_=a.combine(_,{decodedPositions:T.buffer,decodedPositionOffsets:t.buffer})}return _}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./Transforms-06c05e21","./BoxGeometry-769f040a","./Matrix2-e6265fb0","./Color-451a8720","./CylinderGeometry-723ca1ba","./defaultValue-69ee94f4","./EllipsoidGeometry-418f414a","./IndexDatatype-1cbc8622","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryOffsetAttribute-4d39b441","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd","./CylinderGeometryLibrary-fe5ec654"],(function(e,t,n,r,a,i,o,s,c,d,l,f,u,h,p,b,y,x,g){"use strict";function m(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const C=new n.Cartesian3,I=n.Matrix4.packedLength+n.Cartesian3.packedLength,k=n.Matrix4.packedLength+2,M=n.Matrix4.packedLength+n.Cartesian3.packedLength,B=n.Cartesian3.packedLength+1,w={modelMatrix:new n.Matrix4,boundingVolume:new e.BoundingSphere};function A(e,t){let r=t*I;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),w}function O(e,t){let r=t*k;const a=e[r++],i=e[r++],o=n.Cartesian3.fromElements(a,a,i,C),s=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(s,o,s);const c=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,c.center),c.radius=Math.sqrt(2),w}function L(e,t){let r=t*M;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,w}function v(e,t){let r=t*B;const a=e[r++],i=n.Cartesian3.unpack(e,r,C),o=n.Matrix4.fromTranslation(i,w.modelMatrix);n.Matrix4.multiplyByUniformScale(o,a,o);const s=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,w}const E=new n.Cartesian3;function U(t,a,o,s,c){if(!i.defined(a))return;const d=o.length,l=s.attributes.position.values,f=s.indices,u=t.positions,h=t.vertexBatchIds,p=t.indices,b=t.batchIds,y=t.batchTableColors,x=t.batchedIndices,g=t.indexOffsets,C=t.indexCounts,I=t.boundingVolumes,k=t.modelMatrix,M=t.center;let B=t.positionOffset,w=t.batchIdIndex,A=t.indexOffset;const O=t.batchedIndicesOffset;for(let t=0;t<d;++t){const i=c(a,t),s=i.modelMatrix;n.Matrix4.multiply(k,s,s);const d=o[t],L=l.length;for(let e=0;e<L;e+=3){const t=n.Cartesian3.unpack(l,e,E);n.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,M,t),n.Cartesian3.pack(t,u,3*B+e),h[w++]=d}const v=f.length;for(let e=0;e<v;++e)p[A+e]=f[e]+B;const U=t+O;x[U]=new m({offset:A,count:v,color:r.Color.fromRgba(y[d]),batchIds:[d]}),b[U]=d,g[U]=A,C[U]=v,I[U]=e.BoundingSphere.transform(i.boundingVolume,s),B+=L/3,A+=v}t.positionOffset=B,t.batchIdIndex=w,t.indexOffset=A,t.batchedIndicesOffset+=d}const G=new n.Cartesian3,S=new n.Matrix4;function V(t,n,a){const i=a.length,o=2+i*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let a=0;a<t;++a)n+=r.Color.packedLength+3+e[a].batchIds.length;return n}(n),s=new Float64Array(o);let c=0;s[c++]=t,s[c++]=i;for(let t=0;t<i;++t)e.BoundingSphere.pack(a[t],s,c),c+=e.BoundingSphere.packedLength;const d=n.length;s[c++]=d;for(let e=0;e<d;++e){const t=n[e];r.Color.pack(t.color,s,c),c+=r.Color.packedLength,s[c++]=t.offset,s[c++]=t.count;const a=t.batchIds,i=a.length;s[c++]=i;for(let e=0;e<i;++e)s[c++]=a[e]}return s}return c((function(e,r){const c=i.defined(e.boxes)?new Float32Array(e.boxes):void 0,d=i.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,l=i.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,f=i.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,u=i.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=i.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,p=i.defined(e.spheres)?new Float32Array(e.spheres):void 0,b=i.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=i.defined(c)?d.length:0,x=i.defined(l)?f.length:0,g=i.defined(u)?h.length:0,m=i.defined(p)?b.length:0,C=t.BoxGeometry.getUnitBox(),I=a.CylinderGeometry.getUnitCylinder(),k=o.EllipsoidGeometry.getUnitEllipsoid(),M=C.attributes.position.values,B=I.attributes.position.values,w=k.attributes.position.values;let E=M.length*y;E+=B.length*x,E+=w.length*(g+m);const T=C.indices,F=I.indices,R=k.indices;let Z=T.length*y;Z+=F.length*x,Z+=R.length*(g+m);const D=new Float32Array(E),P=new Uint16Array(E/3),_=s.IndexDatatype.createTypedArray(E/3,Z),q=y+x+g+m,W=new Uint16Array(q),j=new Array(q),H=new Uint32Array(q),N=new Uint32Array(q),Y=new Array(q);!function(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,G),r+=n.Cartesian3.packedLength,n.Matrix4.unpack(t,r,S)}(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:D,vertexBatchIds:P,indices:_,batchIds:W,batchedIndices:j,indexOffsets:H,indexCounts:N,boundingVolumes:Y,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:S,center:G};U(z,c,d,C,A),U(z,l,f,I,O),U(z,u,h,k,L),U(z,p,b,k,v);const J=V(_.BYTES_PER_ELEMENT,j,Y);return r.push(D.buffer,P.buffer,_.buffer),r.push(W.buffer,H.buffer,N.buffer),r.push(J.buffer),{positions:D.buffer,vertexBatchIds:P.buffer,indices:_.buffer,indexOffsets:H.buffer,indexCounts:N.buffer,batchIds:W.buffer,packedBuffer:J.buffer}}))})); | ||
define(["./Transforms-fdc0a95d","./BoxGeometry-7949613c","./Matrix2-1ba2543c","./Color-12d5ab6e","./CylinderGeometry-9b5e6460","./defaultValue-69ee94f4","./EllipsoidGeometry-591d0b9b","./IndexDatatype-0b020dfb","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./GeometryOffsetAttribute-4d39b441","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./VertexFormat-e68722dd","./CylinderGeometryLibrary-3c958a1d"],(function(e,t,n,r,a,i,o,s,d,c,l,f,u,h,b,p,y,x,g){"use strict";function m(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}const C=new n.Cartesian3,I=n.Matrix4.packedLength+n.Cartesian3.packedLength,k=n.Matrix4.packedLength+2,M=n.Matrix4.packedLength+n.Cartesian3.packedLength,B=n.Cartesian3.packedLength+1,w={modelMatrix:new n.Matrix4,boundingVolume:new e.BoundingSphere};function A(e,t){let r=t*I;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=Math.sqrt(3),w}function O(e,t){let r=t*k;const a=e[r++],i=e[r++],o=n.Cartesian3.fromElements(a,a,i,C),s=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(s,o,s);const d=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,d.center),d.radius=Math.sqrt(2),w}function L(e,t){let r=t*M;const a=n.Cartesian3.unpack(e,r,C);r+=n.Cartesian3.packedLength;const i=n.Matrix4.unpack(e,r,w.modelMatrix);n.Matrix4.multiplyByScale(i,a,i);const o=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=1,w}function v(e,t){let r=t*B;const a=e[r++],i=n.Cartesian3.unpack(e,r,C),o=n.Matrix4.fromTranslation(i,w.modelMatrix);n.Matrix4.multiplyByUniformScale(o,a,o);const s=w.boundingVolume;return n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=1,w}const E=new n.Cartesian3;function U(t,a,o,s,d){if(!i.defined(a))return;const c=o.length,l=s.attributes.position.values,f=s.indices,u=t.positions,h=t.vertexBatchIds,b=t.indices,p=t.batchIds,y=t.batchTableColors,x=t.batchedIndices,g=t.indexOffsets,C=t.indexCounts,I=t.boundingVolumes,k=t.modelMatrix,M=t.center;let B=t.positionOffset,w=t.batchIdIndex,A=t.indexOffset;const O=t.batchedIndicesOffset;for(let t=0;t<c;++t){const i=d(a,t),s=i.modelMatrix;n.Matrix4.multiply(k,s,s);const c=o[t],L=l.length;for(let e=0;e<L;e+=3){const t=n.Cartesian3.unpack(l,e,E);n.Matrix4.multiplyByPoint(s,t,t),n.Cartesian3.subtract(t,M,t),n.Cartesian3.pack(t,u,3*B+e),h[w++]=c}const v=f.length;for(let e=0;e<v;++e)b[A+e]=f[e]+B;const U=t+O;x[U]=new m({offset:A,count:v,color:r.Color.fromRgba(y[c]),batchIds:[c]}),p[U]=c,g[U]=A,C[U]=v,I[U]=e.BoundingSphere.transform(i.boundingVolume,s),B+=L/3,A+=v}t.positionOffset=B,t.batchIdIndex=w,t.indexOffset=A,t.batchedIndicesOffset+=c}const G=new n.Cartesian3,S=new n.Matrix4;function V(t,n,a){const i=a.length,o=2+i*e.BoundingSphere.packedLength+1+function(e){const t=e.length;let n=0;for(let a=0;a<t;++a)n+=r.Color.packedLength+3+e[a].batchIds.length;return n}(n),s=new Float64Array(o);let d=0;s[d++]=t,s[d++]=i;for(let t=0;t<i;++t)e.BoundingSphere.pack(a[t],s,d),d+=e.BoundingSphere.packedLength;const c=n.length;s[d++]=c;for(let e=0;e<c;++e){const t=n[e];r.Color.pack(t.color,s,d),d+=r.Color.packedLength,s[d++]=t.offset,s[d++]=t.count;const a=t.batchIds,i=a.length;s[d++]=i;for(let e=0;e<i;++e)s[d++]=a[e]}return s}return d((function(e,r){const d=i.defined(e.boxes)?new Float32Array(e.boxes):void 0,c=i.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,l=i.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,f=i.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,u=i.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=i.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,b=i.defined(e.spheres)?new Float32Array(e.spheres):void 0,p=i.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=i.defined(d)?c.length:0,x=i.defined(l)?f.length:0,g=i.defined(u)?h.length:0,m=i.defined(b)?p.length:0,C=t.BoxGeometry.getUnitBox(),I=a.CylinderGeometry.getUnitCylinder(),k=o.EllipsoidGeometry.getUnitEllipsoid(),M=C.attributes.position.values,B=I.attributes.position.values,w=k.attributes.position.values;let E=M.length*y;E+=B.length*x,E+=w.length*(g+m);const T=C.indices,F=I.indices,R=k.indices;let Z=T.length*y;Z+=F.length*x,Z+=R.length*(g+m);const D=new Float32Array(E),P=new Uint16Array(E/3),_=s.IndexDatatype.createTypedArray(E/3,Z),q=y+x+g+m,W=new Uint16Array(q),j=new Array(q),H=new Uint32Array(q),N=new Uint32Array(q),Y=new Array(q);!function(e){const t=new Float64Array(e);let r=0;n.Cartesian3.unpack(t,r,G),r+=n.Cartesian3.packedLength,n.Matrix4.unpack(t,r,S)}(e.packedBuffer);const z={batchTableColors:new Uint32Array(e.batchTableColors),positions:D,vertexBatchIds:P,indices:_,batchIds:W,batchedIndices:j,indexOffsets:H,indexCounts:N,boundingVolumes:Y,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:S,center:G};U(z,d,c,C,A),U(z,l,f,I,O),U(z,u,h,k,L),U(z,b,p,k,v);const J=V(_.BYTES_PER_ELEMENT,j,Y);return r.push(D.buffer,P.buffer,_.buffer),r.push(W.buffer,H.buffer,N.buffer),r.push(J.buffer),{positions:D.buffer,vertexBatchIds:P.buffer,indices:_.buffer,indexOffsets:H.buffer,indexCounts:N.buffer,batchIds:W.buffer,packedBuffer:J.buffer}}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./AttributeCompression-6e71d14f","./Matrix2-e6265fb0","./ComponentDatatype-a9820060","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(e,a,t,r,n,o,i){"use strict";const s=32767,c=new a.Cartographic,u=new a.Cartesian3,p=new a.Rectangle,l=new a.Ellipsoid,f={min:void 0,max:void 0};return r((function(r,n){const o=new Uint16Array(r.positions);!function(e){e=new Float64Array(e);let t=0;f.min=e[t++],f.max=e[t++],a.Rectangle.unpack(e,t,p),t+=a.Rectangle.packedLength,a.Ellipsoid.unpack(e,t,l)}(r.packedBuffer);const i=p,m=l,h=f.min,C=f.max,d=o.length/3,g=o.subarray(0,d),b=o.subarray(d,2*d),w=o.subarray(2*d,3*d);e.AttributeCompression.zigZagDeltaDecode(g,b,w);const k=new Float64Array(o.length);for(let e=0;e<d;++e){const r=g[e],n=b[e],o=w[e],p=t.CesiumMath.lerp(i.west,i.east,r/s),l=t.CesiumMath.lerp(i.south,i.north,n/s),f=t.CesiumMath.lerp(h,C,o/s),d=a.Cartographic.fromRadians(p,l,f,c),y=m.cartographicToCartesian(d,u);a.Cartesian3.pack(y,k,3*e)}return n.push(k.buffer),{positions:k.buffer}}))})); | ||
define(["./AttributeCompression-4c4a8822","./Matrix2-1ba2543c","./ComponentDatatype-07fbb0d4","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(e,a,t,r,n,o,i){"use strict";const s=32767,c=new a.Cartographic,u=new a.Cartesian3,p=new a.Rectangle,l=new a.Ellipsoid,f={min:void 0,max:void 0};return r((function(r,n){const o=new Uint16Array(r.positions);!function(e){e=new Float64Array(e);let t=0;f.min=e[t++],f.max=e[t++],a.Rectangle.unpack(e,t,p),t+=a.Rectangle.packedLength,a.Ellipsoid.unpack(e,t,l)}(r.packedBuffer);const i=p,m=l,h=f.min,C=f.max,b=o.length/3,d=o.subarray(0,b),g=o.subarray(b,2*b),w=o.subarray(2*b,3*b);e.AttributeCompression.zigZagDeltaDecode(d,g,w);const k=new Float64Array(o.length);for(let e=0;e<b;++e){const r=d[e],n=g[e],o=w[e],p=t.CesiumMath.lerp(i.west,i.east,r/s),l=t.CesiumMath.lerp(i.south,i.north,n/s),f=t.CesiumMath.lerp(h,C,o/s),b=a.Cartographic.fromRadians(p,l,f,c),y=m.cartographicToCartesian(b,u);a.Cartesian3.pack(y,k,3*e)}return n.push(k.buffer),{positions:k.buffer}}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./AttributeCompression-6e71d14f","./Matrix2-e6265fb0","./Color-451a8720","./defaultValue-69ee94f4","./IndexDatatype-1cbc8622","./ComponentDatatype-a9820060","./OrientedBoundingBox-0f36ec8f","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./Transforms-06c05e21","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,n,a,r,o,s,i,c,f,d,l,u,h,g,p,b){"use strict";const m=new t.Cartesian3,y=new t.Ellipsoid,C=new t.Rectangle,I={min:void 0,max:void 0,indexBytesPerElement:void 0};function x(e,t,a){const r=t.length,o=2+r*s.OrientedBoundingBox.packedLength+1+function(e){const t=e.length;let a=0;for(let r=0;r<t;++r)a+=n.Color.packedLength+3+e[r].batchIds.length;return a}(a),i=new Float64Array(o);let c=0;i[c++]=e,i[c++]=r;for(let e=0;e<r;++e)s.OrientedBoundingBox.pack(t[e],i,c),c+=s.OrientedBoundingBox.packedLength;const f=a.length;i[c++]=f;for(let e=0;e<f;++e){const t=a[e];n.Color.pack(t.color,i,c),c+=n.Color.packedLength,i[c++]=t.offset,i[c++]=t.count;const r=t.batchIds,o=r.length;i[c++]=o;for(let e=0;e<o;++e)i[c++]=r[e]}return i}const w=new t.Cartesian3,A=new t.Cartesian3,E=new t.Cartesian3,N=new t.Cartesian3,T=new t.Cartesian3,B=new t.Cartographic,k=new t.Rectangle;return i((function(i,c){let f;!function(e){const n=new Float64Array(e);let a=0;I.indexBytesPerElement=n[a++],I.min=n[a++],I.max=n[a++],t.Cartesian3.unpack(n,a,m),a+=t.Cartesian3.packedLength,t.Ellipsoid.unpack(n,a,y),a+=t.Ellipsoid.packedLength,t.Rectangle.unpack(n,a,C)}(i.packedBuffer),f=2===I.indexBytesPerElement?new Uint16Array(i.indices):new Uint32Array(i.indices);const d=new Uint16Array(i.positions),l=new Uint32Array(i.counts),u=new Uint32Array(i.indexCounts),h=new Uint32Array(i.batchIds),g=new Uint32Array(i.batchTableColors),p=new Array(l.length),b=m,L=y;let O=C;const U=I.min,P=I.max;let F,S,D,R=i.minimumHeights,_=i.maximumHeights;a.defined(R)&&a.defined(_)&&(R=new Float32Array(R),_=new Float32Array(_));const M=d.length/2,G=d.subarray(0,M),V=d.subarray(M,2*M);e.AttributeCompression.zigZagDeltaDecode(G,V);const Y=new Float64Array(3*M);for(F=0;F<M;++F){const e=G[F],n=V[F],a=o.CesiumMath.lerp(O.west,O.east,e/32767),r=o.CesiumMath.lerp(O.south,O.north,n/32767),s=t.Cartographic.fromRadians(a,r,0,B),i=L.cartographicToCartesian(s,w);t.Cartesian3.pack(i,Y,3*F)}const H=l.length,v=new Array(H),W=new Array(H);let j=0,z=0;for(F=0;F<H;++F)v[F]=j,W[F]=z,j+=l[F],z+=u[F];const Z=new Float32Array(3*M*2),q=new Uint16Array(2*M),J=new Uint32Array(W.length),K=new Uint32Array(u.length);let Q=[];const X={};for(F=0;F<H;++F)D=g[F],a.defined(X[D])?(X[D].positionLength+=l[F],X[D].indexLength+=u[F],X[D].batchIds.push(F)):X[D]={positionLength:l[F],indexLength:u[F],offset:0,indexOffset:0,batchIds:[F]};let $,ee=0,te=0;for(D in X)if(X.hasOwnProperty(D)){$=X[D],$.offset=ee,$.indexOffset=te;const e=2*$.positionLength,t=2*$.indexLength+6*$.positionLength;ee+=e,te+=t,$.indexLength=t}const ne=[];for(D in X)X.hasOwnProperty(D)&&($=X[D],ne.push({color:n.Color.fromRgba(parseInt(D)),offset:$.indexOffset,count:$.indexLength,batchIds:$.batchIds}));for(F=0;F<H;++F){D=g[F],$=X[D];const e=$.offset;let n=3*e,r=e;const o=v[F],i=l[F],c=h[F];let d=U,m=P;a.defined(R)&&a.defined(_)&&(d=R[F],m=_[F]);let y=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(S=0;S<i;++S){const e=t.Cartesian3.unpack(Y,3*o+3*S,w);L.scaleToGeodeticSurface(e,e);const a=L.cartesianToCartographic(e,B),s=a.latitude,i=a.longitude;y=Math.min(s,y),C=Math.max(s,C),I=Math.min(i,I),x=Math.max(i,x);const f=L.geodeticSurfaceNormal(e,A);let l=t.Cartesian3.multiplyByScalar(f,d,E);const u=t.Cartesian3.add(e,l,N);l=t.Cartesian3.multiplyByScalar(f,m,l);const h=t.Cartesian3.add(e,l,T);t.Cartesian3.subtract(h,b,h),t.Cartesian3.subtract(u,b,u),t.Cartesian3.pack(h,Z,n),t.Cartesian3.pack(u,Z,n+3),q[r]=c,q[r+1]=c,n+=6,r+=2}O=k,O.west=I,O.east=x,O.south=y,O.north=C,p[F]=s.OrientedBoundingBox.fromRectangle(O,U,P,L);let M=$.indexOffset;const G=W[F],V=u[F];for(J[F]=M,S=0;S<V;S+=3){const t=f[G+S]-o,n=f[G+S+1]-o,a=f[G+S+2]-o;Q[M++]=2*t+e,Q[M++]=2*n+e,Q[M++]=2*a+e,Q[M++]=2*a+1+e,Q[M++]=2*n+1+e,Q[M++]=2*t+1+e}for(S=0;S<i;++S){const t=S,n=(S+1)%i;Q[M++]=2*t+1+e,Q[M++]=2*n+e,Q[M++]=2*t+e,Q[M++]=2*t+1+e,Q[M++]=2*n+1+e,Q[M++]=2*n+e}$.offset+=2*i,$.indexOffset=M,K[F]=M-J[F]}Q=r.IndexDatatype.createTypedArray(Z.length/3,Q);const ae=ne.length;for(let e=0;e<ae;++e){const t=ne[e].batchIds;let n=0;const a=t.length;for(let e=0;e<a;++e)n+=K[t[e]];ne[e].count=n}const re=x(2===Q.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,p,ne);return c.push(Z.buffer,Q.buffer,J.buffer,K.buffer,q.buffer,re.buffer),{positions:Z.buffer,indices:Q.buffer,indexOffsets:J.buffer,indexCounts:K.buffer,batchIds:q.buffer,packedBuffer:re.buffer}}))})); | ||
define(["./AttributeCompression-4c4a8822","./Matrix2-1ba2543c","./Color-12d5ab6e","./defaultValue-69ee94f4","./IndexDatatype-0b020dfb","./ComponentDatatype-07fbb0d4","./OrientedBoundingBox-966209b7","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,n,a,r,o,s,i,c,f,d,l,u,h,g,p,b){"use strict";const m=new t.Cartesian3,y=new t.Ellipsoid,C=new t.Rectangle,I={min:void 0,max:void 0,indexBytesPerElement:void 0};function x(e,t,a){const r=t.length,o=2+r*s.OrientedBoundingBox.packedLength+1+function(e){const t=e.length;let a=0;for(let r=0;r<t;++r)a+=n.Color.packedLength+3+e[r].batchIds.length;return a}(a),i=new Float64Array(o);let c=0;i[c++]=e,i[c++]=r;for(let e=0;e<r;++e)s.OrientedBoundingBox.pack(t[e],i,c),c+=s.OrientedBoundingBox.packedLength;const f=a.length;i[c++]=f;for(let e=0;e<f;++e){const t=a[e];n.Color.pack(t.color,i,c),c+=n.Color.packedLength,i[c++]=t.offset,i[c++]=t.count;const r=t.batchIds,o=r.length;i[c++]=o;for(let e=0;e<o;++e)i[c++]=r[e]}return i}const w=new t.Cartesian3,A=new t.Cartesian3,E=new t.Cartesian3,N=new t.Cartesian3,T=new t.Cartesian3,B=new t.Cartographic,k=new t.Rectangle;return i((function(i,c){let f;!function(e){const n=new Float64Array(e);let a=0;I.indexBytesPerElement=n[a++],I.min=n[a++],I.max=n[a++],t.Cartesian3.unpack(n,a,m),a+=t.Cartesian3.packedLength,t.Ellipsoid.unpack(n,a,y),a+=t.Ellipsoid.packedLength,t.Rectangle.unpack(n,a,C)}(i.packedBuffer),f=2===I.indexBytesPerElement?new Uint16Array(i.indices):new Uint32Array(i.indices);const d=new Uint16Array(i.positions),l=new Uint32Array(i.counts),u=new Uint32Array(i.indexCounts),h=new Uint32Array(i.batchIds),g=new Uint32Array(i.batchTableColors),p=new Array(l.length),b=m,L=y;let O=C;const U=I.min,P=I.max;let F,S,D,R=i.minimumHeights,_=i.maximumHeights;a.defined(R)&&a.defined(_)&&(R=new Float32Array(R),_=new Float32Array(_));const M=d.length/2,G=d.subarray(0,M),V=d.subarray(M,2*M);e.AttributeCompression.zigZagDeltaDecode(G,V);const Y=new Float64Array(3*M);for(F=0;F<M;++F){const e=G[F],n=V[F],a=o.CesiumMath.lerp(O.west,O.east,e/32767),r=o.CesiumMath.lerp(O.south,O.north,n/32767),s=t.Cartographic.fromRadians(a,r,0,B),i=L.cartographicToCartesian(s,w);t.Cartesian3.pack(i,Y,3*F)}const H=l.length,v=new Array(H),W=new Array(H);let j=0,z=0;for(F=0;F<H;++F)v[F]=j,W[F]=z,j+=l[F],z+=u[F];const Z=new Float32Array(3*M*2),q=new Uint16Array(2*M),J=new Uint32Array(W.length),K=new Uint32Array(u.length);let Q=[];const X={};for(F=0;F<H;++F)D=g[F],a.defined(X[D])?(X[D].positionLength+=l[F],X[D].indexLength+=u[F],X[D].batchIds.push(F)):X[D]={positionLength:l[F],indexLength:u[F],offset:0,indexOffset:0,batchIds:[F]};let $,ee=0,te=0;for(D in X)if(X.hasOwnProperty(D)){$=X[D],$.offset=ee,$.indexOffset=te;const e=2*$.positionLength,t=2*$.indexLength+6*$.positionLength;ee+=e,te+=t,$.indexLength=t}const ne=[];for(D in X)X.hasOwnProperty(D)&&($=X[D],ne.push({color:n.Color.fromRgba(parseInt(D)),offset:$.indexOffset,count:$.indexLength,batchIds:$.batchIds}));for(F=0;F<H;++F){D=g[F],$=X[D];const e=$.offset;let n=3*e,r=e;const o=v[F],i=l[F],c=h[F];let d=U,m=P;a.defined(R)&&a.defined(_)&&(d=R[F],m=_[F]);let y=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(S=0;S<i;++S){const e=t.Cartesian3.unpack(Y,3*o+3*S,w);L.scaleToGeodeticSurface(e,e);const a=L.cartesianToCartographic(e,B),s=a.latitude,i=a.longitude;y=Math.min(s,y),C=Math.max(s,C),I=Math.min(i,I),x=Math.max(i,x);const f=L.geodeticSurfaceNormal(e,A);let l=t.Cartesian3.multiplyByScalar(f,d,E);const u=t.Cartesian3.add(e,l,N);l=t.Cartesian3.multiplyByScalar(f,m,l);const h=t.Cartesian3.add(e,l,T);t.Cartesian3.subtract(h,b,h),t.Cartesian3.subtract(u,b,u),t.Cartesian3.pack(h,Z,n),t.Cartesian3.pack(u,Z,n+3),q[r]=c,q[r+1]=c,n+=6,r+=2}O=k,O.west=I,O.east=x,O.south=y,O.north=C,p[F]=s.OrientedBoundingBox.fromRectangle(O,U,P,L);let M=$.indexOffset;const G=W[F],V=u[F];for(J[F]=M,S=0;S<V;S+=3){const t=f[G+S]-o,n=f[G+S+1]-o,a=f[G+S+2]-o;Q[M++]=2*t+e,Q[M++]=2*n+e,Q[M++]=2*a+e,Q[M++]=2*a+1+e,Q[M++]=2*n+1+e,Q[M++]=2*t+1+e}for(S=0;S<i;++S){const t=S,n=(S+1)%i;Q[M++]=2*t+1+e,Q[M++]=2*n+e,Q[M++]=2*t+e,Q[M++]=2*t+1+e,Q[M++]=2*n+1+e,Q[M++]=2*n+e}$.offset+=2*i,$.indexOffset=M,K[F]=M-J[F]}Q=r.IndexDatatype.createTypedArray(Z.length/3,Q);const ae=ne.length;for(let e=0;e<ae;++e){const t=ne[e].batchIds;let n=0;const a=t.length;for(let e=0;e<a;++e)n+=K[t[e]];ne[e].count=n}const re=x(2===Q.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,p,ne);return c.push(Z.buffer,Q.buffer,J.buffer,K.buffer,q.buffer,re.buffer),{positions:Z.buffer,indices:Q.buffer,indexOffsets:J.buffer,indexCounts:K.buffer,batchIds:q.buffer,packedBuffer:re.buffer}}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./Matrix2-e6265fb0","./combine-0259f56f","./AttributeCompression-6e71d14f","./ComponentDatatype-a9820060","./IndexDatatype-1cbc8622","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(e,t,a,n,r,s,i,o,c){"use strict";const f=32767,u=new e.Cartographic,p=new e.Cartesian3;const l=new e.Rectangle,d=new e.Ellipsoid,C=new e.Cartesian3,b={min:void 0,max:void 0};const w=new e.Cartesian3,y=new e.Cartesian3,h=new e.Cartesian3,k=new e.Cartesian3,m=new e.Cartesian3;return s((function(s,i){const o=new Uint16Array(s.positions),c=new Uint16Array(s.widths),A=new Uint32Array(s.counts),g=new Uint16Array(s.batchIds);!function(t){t=new Float64Array(t);let a=0;b.min=t[a++],b.max=t[a++],e.Rectangle.unpack(t,a,l),a+=e.Rectangle.packedLength,e.Ellipsoid.unpack(t,a,d),a+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(t,a,C)}(s.packedBuffer);const x=d,D=C,E=function(t,r,s,i,o){const c=t.length/3,l=t.subarray(0,c),d=t.subarray(c,2*c),C=t.subarray(2*c,3*c);a.AttributeCompression.zigZagDeltaDecode(l,d,C);const b=new Float64Array(t.length);for(let t=0;t<c;++t){const a=l[t],c=d[t],w=C[t],y=n.CesiumMath.lerp(r.west,r.east,a/f),h=n.CesiumMath.lerp(r.south,r.north,c/f),k=n.CesiumMath.lerp(s,i,w/f),m=e.Cartographic.fromRadians(y,h,k,u),A=o.cartographicToCartesian(m,p);e.Cartesian3.pack(A,b,3*t)}return b}(o,l,b.min,b.max,x),I=E.length/3,P=4*I-4,U=new Float32Array(3*P),R=new Float32Array(3*P),T=new Float32Array(3*P),F=new Float32Array(2*P),N=new Uint16Array(P);let M,L=0,S=0,_=0,v=0,G=A.length;for(M=0;M<G;++M){const t=A[M],a=c[M],n=g[M];for(let r=0;r<t;++r){let s;if(0===r){const t=e.Cartesian3.unpack(E,3*v,w),a=e.Cartesian3.unpack(E,3*(v+1),y);s=e.Cartesian3.subtract(t,a,h),e.Cartesian3.add(t,s,s)}else s=e.Cartesian3.unpack(E,3*(v+r-1),h);const i=e.Cartesian3.unpack(E,3*(v+r),k);let o;if(r===t-1){const a=e.Cartesian3.unpack(E,3*(v+t-1),w),n=e.Cartesian3.unpack(E,3*(v+t-2),y);o=e.Cartesian3.subtract(a,n,m),e.Cartesian3.add(a,o,o)}else o=e.Cartesian3.unpack(E,3*(v+r+1),m);e.Cartesian3.subtract(s,D,s),e.Cartesian3.subtract(i,D,i),e.Cartesian3.subtract(o,D,o);const c=r===t-1?2:4;for(let t=0===r?2:0;t<c;++t){e.Cartesian3.pack(i,U,L),e.Cartesian3.pack(s,R,L),e.Cartesian3.pack(o,T,L),L+=3;const r=t-2<0?-1:1;F[S++]=t%2*2-1,F[S++]=r*a,N[_++]=n}}v+=t}const W=r.IndexDatatype.createTypedArray(P,6*I-6);let B=0,O=0;for(G=I-1,M=0;M<G;++M)W[O++]=B,W[O++]=B+2,W[O++]=B+1,W[O++]=B+1,W[O++]=B+2,W[O++]=B+3,B+=4;i.push(U.buffer,R.buffer,T.buffer),i.push(F.buffer,N.buffer,W.buffer);let z={indexDatatype:2===W.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,currentPositions:U.buffer,previousPositions:R.buffer,nextPositions:T.buffer,expandAndWidth:F.buffer,batchIds:N.buffer,indices:W.buffer};if(s.keepDecodedPositions){const e=function(e){const t=e.length,a=new Uint32Array(t+1);let n=0;for(let r=0;r<t;++r)a[r]=n,n+=e[r];return a[t]=n,a}(A);i.push(E.buffer,e.buffer),z=t.combine(z,{decodedPositions:E.buffer,decodedPositionOffsets:e.buffer})}return z}))})); | ||
define(["./Matrix2-1ba2543c","./combine-0259f56f","./AttributeCompression-4c4a8822","./ComponentDatatype-07fbb0d4","./IndexDatatype-0b020dfb","./createTaskProcessorWorker","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./WebGLConstants-f63312fc"],(function(e,a,t,n,r,s,i,o,c){"use strict";const f=32767,u=new e.Cartographic,p=new e.Cartesian3;const d=new e.Rectangle,l=new e.Ellipsoid,b=new e.Cartesian3,C={min:void 0,max:void 0};const w=new e.Cartesian3,y=new e.Cartesian3,h=new e.Cartesian3,k=new e.Cartesian3,m=new e.Cartesian3;return s((function(s,i){const o=new Uint16Array(s.positions),c=new Uint16Array(s.widths),A=new Uint32Array(s.counts),g=new Uint16Array(s.batchIds);!function(a){a=new Float64Array(a);let t=0;C.min=a[t++],C.max=a[t++],e.Rectangle.unpack(a,t,d),t+=e.Rectangle.packedLength,e.Ellipsoid.unpack(a,t,l),t+=e.Ellipsoid.packedLength,e.Cartesian3.unpack(a,t,b)}(s.packedBuffer);const x=l,D=b,E=function(a,r,s,i,o){const c=a.length/3,d=a.subarray(0,c),l=a.subarray(c,2*c),b=a.subarray(2*c,3*c);t.AttributeCompression.zigZagDeltaDecode(d,l,b);const C=new Float64Array(a.length);for(let a=0;a<c;++a){const t=d[a],c=l[a],w=b[a],y=n.CesiumMath.lerp(r.west,r.east,t/f),h=n.CesiumMath.lerp(r.south,r.north,c/f),k=n.CesiumMath.lerp(s,i,w/f),m=e.Cartographic.fromRadians(y,h,k,u),A=o.cartographicToCartesian(m,p);e.Cartesian3.pack(A,C,3*a)}return C}(o,d,C.min,C.max,x),I=E.length/3,P=4*I-4,U=new Float32Array(3*P),R=new Float32Array(3*P),T=new Float32Array(3*P),F=new Float32Array(2*P),N=new Uint16Array(P);let M,L=0,S=0,_=0,v=0,G=A.length;for(M=0;M<G;++M){const a=A[M],t=c[M],n=g[M];for(let r=0;r<a;++r){let s;if(0===r){const a=e.Cartesian3.unpack(E,3*v,w),t=e.Cartesian3.unpack(E,3*(v+1),y);s=e.Cartesian3.subtract(a,t,h),e.Cartesian3.add(a,s,s)}else s=e.Cartesian3.unpack(E,3*(v+r-1),h);const i=e.Cartesian3.unpack(E,3*(v+r),k);let o;if(r===a-1){const t=e.Cartesian3.unpack(E,3*(v+a-1),w),n=e.Cartesian3.unpack(E,3*(v+a-2),y);o=e.Cartesian3.subtract(t,n,m),e.Cartesian3.add(t,o,o)}else o=e.Cartesian3.unpack(E,3*(v+r+1),m);e.Cartesian3.subtract(s,D,s),e.Cartesian3.subtract(i,D,i),e.Cartesian3.subtract(o,D,o);const c=r===a-1?2:4;for(let a=0===r?2:0;a<c;++a){e.Cartesian3.pack(i,U,L),e.Cartesian3.pack(s,R,L),e.Cartesian3.pack(o,T,L),L+=3;const r=a-2<0?-1:1;F[S++]=a%2*2-1,F[S++]=r*t,N[_++]=n}}v+=a}const W=r.IndexDatatype.createTypedArray(P,6*I-6);let B=0,O=0;for(G=I-1,M=0;M<G;++M)W[O++]=B,W[O++]=B+2,W[O++]=B+1,W[O++]=B+1,W[O++]=B+2,W[O++]=B+3,B+=4;i.push(U.buffer,R.buffer,T.buffer),i.push(F.buffer,N.buffer,W.buffer);let z={indexDatatype:2===W.BYTES_PER_ELEMENT?r.IndexDatatype.UNSIGNED_SHORT:r.IndexDatatype.UNSIGNED_INT,currentPositions:U.buffer,previousPositions:R.buffer,nextPositions:T.buffer,expandAndWidth:F.buffer,batchIds:N.buffer,indices:W.buffer};if(s.keepDecodedPositions){const e=function(e){const a=e.length,t=new Uint32Array(a+1);let n=0;for(let r=0;r<a;++r)t[r]=n,n+=e[r];return t[a]=n,t}(A);i.push(E.buffer,e.buffer),z=a.combine(z,{decodedPositions:E.buffer,decodedPositionOffsets:e.buffer})}return z}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./AxisAlignedBoundingBox-5ba8fa79","./Transforms-06c05e21","./Matrix2-e6265fb0","./defaultValue-69ee94f4","./TerrainEncoding-7f4829f1","./ComponentDatatype-a9820060","./OrientedBoundingBox-0f36ec8f","./RuntimeError-ac440aa5","./WebMercatorProjection-50f5da31","./createTaskProcessorWorker","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./AttributeCompression-6e71d14f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(t,e,n,i,o,a,r,s,c,u,h,l,d,g,m,p,f){"use strict";const I=Uint16Array.BYTES_PER_ELEMENT,E=Int32Array.BYTES_PER_ELEMENT,T=Uint32Array.BYTES_PER_ELEMENT,C=Float32Array.BYTES_PER_ELEMENT,M=Float64Array.BYTES_PER_ELEMENT;function x(t,e,n){n=i.defaultValue(n,a.CesiumMath);const o=t.length;for(let i=0;i<o;++i)if(n.equalsEpsilon(t[i],e,a.CesiumMath.EPSILON12))return i;return-1}const N=new n.Cartographic,b=new n.Cartesian3,S=new n.Cartesian3,w=new n.Cartesian3,B=new n.Matrix4;function P(t,e,o,r,s,c,u,h,l,d,g){const m=h.length;for(let p=0;p<m;++p){const f=h[p],I=f.cartographic,E=f.index,T=t.length,C=I.longitude;let M=I.latitude;M=a.CesiumMath.clamp(M,-a.CesiumMath.PI_OVER_TWO,a.CesiumMath.PI_OVER_TWO);const x=I.height-u.skirtHeight;u.hMin=Math.min(u.hMin,x),n.Cartographic.fromRadians(C,M,x,N),d&&(N.longitude+=l),d?p===m-1?N.latitude+=g:0===p&&(N.latitude-=g):N.latitude+=l;const S=u.ellipsoid.cartographicToCartesian(N);t.push(S),e.push(x),o.push(n.Cartesian2.clone(o[E])),r.length>0&&r.push(r[E]),s.length>0&&s.push(s[E]),n.Matrix4.multiplyByPoint(u.toENU,S,b);const w=u.minimum,B=u.maximum;n.Cartesian3.minimumByComponent(b,w,w),n.Cartesian3.maximumByComponent(b,B,B);const P=u.lastBorderPoint;if(i.defined(P)){const t=P.index;c.push(t,T-1,T,T,E,t)}u.lastBorderPoint=f}}return u((function(u,h){u.ellipsoid=n.Ellipsoid.clone(u.ellipsoid),u.rectangle=n.Rectangle.clone(u.rectangle);const l=function(u,h,l,d,g,m,p,f,A,y,R){let _,W,v,F,O,V;i.defined(d)?(_=d.west,W=d.south,v=d.east,F=d.north,O=d.width,V=d.height):(_=a.CesiumMath.toRadians(g.west),W=a.CesiumMath.toRadians(g.south),v=a.CesiumMath.toRadians(g.east),F=a.CesiumMath.toRadians(g.north),O=a.CesiumMath.toRadians(d.width),V=a.CesiumMath.toRadians(d.height));const Y=[W,F],H=[_,v],U=e.Transforms.eastNorthUpToFixedFrame(h,l),k=n.Matrix4.inverseTransformation(U,B);let L,j;A&&(L=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(W),j=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F)-L));const D=1!==m,G=new DataView(u);let z=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY;const J=S;J.x=Number.POSITIVE_INFINITY,J.y=Number.POSITIVE_INFINITY,J.z=Number.POSITIVE_INFINITY;const K=w;K.x=Number.NEGATIVE_INFINITY,K.y=Number.NEGATIVE_INFINITY,K.z=Number.NEGATIVE_INFINITY;let Q,X,Z=0,$=0,tt=0;for(X=0;X<4;++X){let t=Z;Q=G.getUint32(t,!0),t+=T;const e=a.CesiumMath.toRadians(180*G.getFloat64(t,!0));t+=M,-1===x(H,e)&&H.push(e);const n=a.CesiumMath.toRadians(180*G.getFloat64(t,!0));t+=M,-1===x(Y,n)&&Y.push(n),t+=2*M;let i=G.getInt32(t,!0);t+=E,$+=i,i=G.getInt32(t,!0),tt+=3*i,Z+=Q+T}const et=[],nt=[],it=new Array($),ot=new Array($),at=new Array($),rt=A?new Array($):[],st=D?new Array($):[],ct=new Array(tt),ut=[],ht=[],lt=[],dt=[];let gt=0,mt=0;for(Z=0,X=0;X<4;++X){Q=G.getUint32(Z,!0),Z+=T;const t=Z,e=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0));Z+=M;const i=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0));Z+=M;const o=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0)),r=.5*o;Z+=M;const u=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0)),h=.5*u;Z+=M;const d=G.getInt32(Z,!0);Z+=E;const g=G.getInt32(Z,!0);Z+=E,Z+=E;const m=new Array(d);for(let t=0;t<d;++t){const s=e+G.getUint8(Z++)*o;N.longitude=s;const d=i+G.getUint8(Z++)*u;N.latitude=d;let g=G.getFloat32(Z,!0);if(Z+=C,0!==g&&g<R&&(g*=-Math.pow(2,y)),g*=6371010,N.height=g,-1!==x(H,s)||-1!==x(Y,d)){const e=x(et,N,n.Cartographic);if(-1!==e){m[t]=nt[e];continue}et.push(n.Cartographic.clone(N)),nt.push(gt)}m[t]=gt,Math.abs(s-_)<r?ut.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(s-v)<r?lt.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(d-W)<h?ht.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(d-F)<h&&dt.push({index:gt,cartographic:n.Cartographic.clone(N)}),z=Math.min(g,z),q=Math.max(g,q),at[gt]=g;const p=l.cartographicToCartesian(N);if(it[gt]=p,A&&(rt[gt]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(d)-L)*j),D){const t=l.geodeticSurfaceNormal(p);st[gt]=t}n.Matrix4.multiplyByPoint(k,p,b),n.Cartesian3.minimumByComponent(b,J,J),n.Cartesian3.maximumByComponent(b,K,K);let f=(s-_)/(v-_);f=a.CesiumMath.clamp(f,0,1);let I=(d-W)/(F-W);I=a.CesiumMath.clamp(I,0,1),ot[gt]=new n.Cartesian2(f,I),++gt}const p=3*g;for(let t=0;t<p;++t,++mt)ct[mt]=m[G.getUint16(Z,!0)],Z+=I;if(Q!==Z-t)throw new s.RuntimeError("Invalid terrain tile.")}it.length=gt,ot.length=gt,at.length=gt,A&&(rt.length=gt);D&&(st.length=gt);const pt=gt,ft=mt,It={hMin:z,lastBorderPoint:void 0,skirtHeight:f,toENU:k,ellipsoid:l,minimum:J,maximum:K};ut.sort((function(t,e){return e.cartographic.latitude-t.cartographic.latitude})),ht.sort((function(t,e){return t.cartographic.longitude-e.cartographic.longitude})),lt.sort((function(t,e){return t.cartographic.latitude-e.cartographic.latitude})),dt.sort((function(t,e){return e.cartographic.longitude-t.cartographic.longitude}));const Et=1e-5;if(P(it,at,ot,rt,st,ct,It,ut,-Et*O,!0,-Et*V),P(it,at,ot,rt,st,ct,It,ht,-Et*V,!1),P(it,at,ot,rt,st,ct,It,lt,Et*O,!0,Et*V),P(it,at,ot,rt,st,ct,It,dt,Et*V,!1),ut.length>0&&dt.length>0){const t=ut[0].index,e=pt,n=dt[dt.length-1].index,i=it.length-1;ct.push(n,i,e,e,t,n)}$=it.length;const Tt=e.BoundingSphere.fromPoints(it);let Ct;i.defined(d)&&(Ct=r.OrientedBoundingBox.fromRectangle(d,z,q,l));const Mt=new o.EllipsoidalOccluder(l).computeHorizonCullingPointPossiblyUnderEllipsoid(h,it,z),xt=new t.AxisAlignedBoundingBox(J,K,h),Nt=new o.TerrainEncoding(h,xt,It.hMin,q,U,!1,A,D,m,p),bt=new Float32Array($*Nt.stride);let St=0;for(let t=0;t<$;++t)St=Nt.encode(bt,St,it[t],ot[t],at[t],void 0,rt[t],st[t]);const wt=ut.map((function(t){return t.index})).reverse(),Bt=ht.map((function(t){return t.index})).reverse(),Pt=lt.map((function(t){return t.index})).reverse(),At=dt.map((function(t){return t.index})).reverse();return Bt.unshift(Pt[Pt.length-1]),Bt.push(wt[0]),At.unshift(wt[wt.length-1]),At.push(Pt[0]),{vertices:bt,indices:new Uint16Array(ct),maximumHeight:q,minimumHeight:z,encoding:Nt,boundingSphere3D:Tt,orientedBoundingBox:Ct,occludeePointInScaledSpace:Mt,vertexCountWithoutSkirts:pt,indexCountWithoutSkirts:ft,westIndicesSouthToNorth:wt,southIndicesEastToWest:Bt,eastIndicesNorthToSouth:Pt,northIndicesWestToEast:At}}(u.buffer,u.relativeToCenter,u.ellipsoid,u.rectangle,u.nativeRectangle,u.exaggeration,u.exaggerationRelativeHeight,u.skirtHeight,u.includeWebMercatorT,u.negativeAltitudeExponentBias,u.negativeElevationThreshold),d=l.vertices;h.push(d.buffer);const g=l.indices;return h.push(g.buffer),{vertices:d.buffer,indices:g.buffer,numberOfAttributes:l.encoding.stride,minimumHeight:l.minimumHeight,maximumHeight:l.maximumHeight,boundingSphere3D:l.boundingSphere3D,orientedBoundingBox:l.orientedBoundingBox,occludeePointInScaledSpace:l.occludeePointInScaledSpace,encoding:l.encoding,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indexCountWithoutSkirts:l.indexCountWithoutSkirts,westIndicesSouthToNorth:l.westIndicesSouthToNorth,southIndicesEastToWest:l.southIndicesEastToWest,eastIndicesNorthToSouth:l.eastIndicesNorthToSouth,northIndicesWestToEast:l.northIndicesWestToEast}}))})); | ||
define(["./AxisAlignedBoundingBox-dd1e93db","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./defaultValue-69ee94f4","./TerrainEncoding-365ddcc9","./ComponentDatatype-07fbb0d4","./OrientedBoundingBox-966209b7","./RuntimeError-ac440aa5","./WebMercatorProjection-7e95daf8","./createTaskProcessorWorker","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./AttributeCompression-4c4a8822","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(t,e,n,i,o,a,r,s,c,u,h,d,l,g,m,p,f){"use strict";const I=Uint16Array.BYTES_PER_ELEMENT,E=Int32Array.BYTES_PER_ELEMENT,T=Uint32Array.BYTES_PER_ELEMENT,C=Float32Array.BYTES_PER_ELEMENT,M=Float64Array.BYTES_PER_ELEMENT;function x(t,e,n){n=i.defaultValue(n,a.CesiumMath);const o=t.length;for(let i=0;i<o;++i)if(n.equalsEpsilon(t[i],e,a.CesiumMath.EPSILON12))return i;return-1}const N=new n.Cartographic,b=new n.Cartesian3,S=new n.Cartesian3,w=new n.Cartesian3,B=new n.Matrix4;function P(t,e,o,r,s,c,u,h,d,l,g){const m=h.length;for(let p=0;p<m;++p){const f=h[p],I=f.cartographic,E=f.index,T=t.length,C=I.longitude;let M=I.latitude;M=a.CesiumMath.clamp(M,-a.CesiumMath.PI_OVER_TWO,a.CesiumMath.PI_OVER_TWO);const x=I.height-u.skirtHeight;u.hMin=Math.min(u.hMin,x),n.Cartographic.fromRadians(C,M,x,N),l&&(N.longitude+=d),l?p===m-1?N.latitude+=g:0===p&&(N.latitude-=g):N.latitude+=d;const S=u.ellipsoid.cartographicToCartesian(N);t.push(S),e.push(x),o.push(n.Cartesian2.clone(o[E])),r.length>0&&r.push(r[E]),s.length>0&&s.push(s[E]),n.Matrix4.multiplyByPoint(u.toENU,S,b);const w=u.minimum,B=u.maximum;n.Cartesian3.minimumByComponent(b,w,w),n.Cartesian3.maximumByComponent(b,B,B);const P=u.lastBorderPoint;if(i.defined(P)){const t=P.index;c.push(t,T-1,T,T,E,t)}u.lastBorderPoint=f}}return u((function(u,h){u.ellipsoid=n.Ellipsoid.clone(u.ellipsoid),u.rectangle=n.Rectangle.clone(u.rectangle);const d=function(u,h,d,l,g,m,p,f,A,y,R){let _,W,v,F,O,V;i.defined(l)?(_=l.west,W=l.south,v=l.east,F=l.north,O=l.width,V=l.height):(_=a.CesiumMath.toRadians(g.west),W=a.CesiumMath.toRadians(g.south),v=a.CesiumMath.toRadians(g.east),F=a.CesiumMath.toRadians(g.north),O=a.CesiumMath.toRadians(l.width),V=a.CesiumMath.toRadians(l.height));const Y=[W,F],H=[_,v],U=e.Transforms.eastNorthUpToFixedFrame(h,d),k=n.Matrix4.inverseTransformation(U,B);let L,j;A&&(L=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(W),j=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F)-L));const D=1!==m,G=new DataView(u);let z=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY;const J=S;J.x=Number.POSITIVE_INFINITY,J.y=Number.POSITIVE_INFINITY,J.z=Number.POSITIVE_INFINITY;const K=w;K.x=Number.NEGATIVE_INFINITY,K.y=Number.NEGATIVE_INFINITY,K.z=Number.NEGATIVE_INFINITY;let Q,X,Z=0,$=0,tt=0;for(X=0;X<4;++X){let t=Z;Q=G.getUint32(t,!0),t+=T;const e=a.CesiumMath.toRadians(180*G.getFloat64(t,!0));t+=M,-1===x(H,e)&&H.push(e);const n=a.CesiumMath.toRadians(180*G.getFloat64(t,!0));t+=M,-1===x(Y,n)&&Y.push(n),t+=2*M;let i=G.getInt32(t,!0);t+=E,$+=i,i=G.getInt32(t,!0),tt+=3*i,Z+=Q+T}const et=[],nt=[],it=new Array($),ot=new Array($),at=new Array($),rt=A?new Array($):[],st=D?new Array($):[],ct=new Array(tt),ut=[],ht=[],dt=[],lt=[];let gt=0,mt=0;for(Z=0,X=0;X<4;++X){Q=G.getUint32(Z,!0),Z+=T;const t=Z,e=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0));Z+=M;const i=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0));Z+=M;const o=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0)),r=.5*o;Z+=M;const u=a.CesiumMath.toRadians(180*G.getFloat64(Z,!0)),h=.5*u;Z+=M;const l=G.getInt32(Z,!0);Z+=E;const g=G.getInt32(Z,!0);Z+=E,Z+=E;const m=new Array(l);for(let t=0;t<l;++t){const s=e+G.getUint8(Z++)*o;N.longitude=s;const l=i+G.getUint8(Z++)*u;N.latitude=l;let g=G.getFloat32(Z,!0);if(Z+=C,0!==g&&g<R&&(g*=-Math.pow(2,y)),g*=6371010,N.height=g,-1!==x(H,s)||-1!==x(Y,l)){const e=x(et,N,n.Cartographic);if(-1!==e){m[t]=nt[e];continue}et.push(n.Cartographic.clone(N)),nt.push(gt)}m[t]=gt,Math.abs(s-_)<r?ut.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(s-v)<r?dt.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(l-W)<h?ht.push({index:gt,cartographic:n.Cartographic.clone(N)}):Math.abs(l-F)<h&<.push({index:gt,cartographic:n.Cartographic.clone(N)}),z=Math.min(g,z),q=Math.max(g,q),at[gt]=g;const p=d.cartographicToCartesian(N);if(it[gt]=p,A&&(rt[gt]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(l)-L)*j),D){const t=d.geodeticSurfaceNormal(p);st[gt]=t}n.Matrix4.multiplyByPoint(k,p,b),n.Cartesian3.minimumByComponent(b,J,J),n.Cartesian3.maximumByComponent(b,K,K);let f=(s-_)/(v-_);f=a.CesiumMath.clamp(f,0,1);let I=(l-W)/(F-W);I=a.CesiumMath.clamp(I,0,1),ot[gt]=new n.Cartesian2(f,I),++gt}const p=3*g;for(let t=0;t<p;++t,++mt)ct[mt]=m[G.getUint16(Z,!0)],Z+=I;if(Q!==Z-t)throw new s.RuntimeError("Invalid terrain tile.")}it.length=gt,ot.length=gt,at.length=gt,A&&(rt.length=gt);D&&(st.length=gt);const pt=gt,ft=mt,It={hMin:z,lastBorderPoint:void 0,skirtHeight:f,toENU:k,ellipsoid:d,minimum:J,maximum:K};ut.sort((function(t,e){return e.cartographic.latitude-t.cartographic.latitude})),ht.sort((function(t,e){return t.cartographic.longitude-e.cartographic.longitude})),dt.sort((function(t,e){return t.cartographic.latitude-e.cartographic.latitude})),lt.sort((function(t,e){return e.cartographic.longitude-t.cartographic.longitude}));const Et=1e-5;if(P(it,at,ot,rt,st,ct,It,ut,-Et*O,!0,-Et*V),P(it,at,ot,rt,st,ct,It,ht,-Et*V,!1),P(it,at,ot,rt,st,ct,It,dt,Et*O,!0,Et*V),P(it,at,ot,rt,st,ct,It,lt,Et*V,!1),ut.length>0&<.length>0){const t=ut[0].index,e=pt,n=lt[lt.length-1].index,i=it.length-1;ct.push(n,i,e,e,t,n)}$=it.length;const Tt=e.BoundingSphere.fromPoints(it);let Ct;i.defined(l)&&(Ct=r.OrientedBoundingBox.fromRectangle(l,z,q,d));const Mt=new o.EllipsoidalOccluder(d).computeHorizonCullingPointPossiblyUnderEllipsoid(h,it,z),xt=new t.AxisAlignedBoundingBox(J,K,h),Nt=new o.TerrainEncoding(h,xt,It.hMin,q,U,!1,A,D,m,p),bt=new Float32Array($*Nt.stride);let St=0;for(let t=0;t<$;++t)St=Nt.encode(bt,St,it[t],ot[t],at[t],void 0,rt[t],st[t]);const wt=ut.map((function(t){return t.index})).reverse(),Bt=ht.map((function(t){return t.index})).reverse(),Pt=dt.map((function(t){return t.index})).reverse(),At=lt.map((function(t){return t.index})).reverse();return Bt.unshift(Pt[Pt.length-1]),Bt.push(wt[0]),At.unshift(wt[wt.length-1]),At.push(Pt[0]),{vertices:bt,indices:new Uint16Array(ct),maximumHeight:q,minimumHeight:z,encoding:Nt,boundingSphere3D:Tt,orientedBoundingBox:Ct,occludeePointInScaledSpace:Mt,vertexCountWithoutSkirts:pt,indexCountWithoutSkirts:ft,westIndicesSouthToNorth:wt,southIndicesEastToWest:Bt,eastIndicesNorthToSouth:Pt,northIndicesWestToEast:At}}(u.buffer,u.relativeToCenter,u.ellipsoid,u.rectangle,u.nativeRectangle,u.exaggeration,u.exaggerationRelativeHeight,u.skirtHeight,u.includeWebMercatorT,u.negativeAltitudeExponentBias,u.negativeElevationThreshold),l=d.vertices;h.push(l.buffer);const g=d.indices;return h.push(g.buffer),{vertices:l.buffer,indices:g.buffer,numberOfAttributes:d.encoding.stride,minimumHeight:d.minimumHeight,maximumHeight:d.maximumHeight,boundingSphere3D:d.boundingSphere3D,orientedBoundingBox:d.orientedBoundingBox,occludeePointInScaledSpace:d.occludeePointInScaledSpace,encoding:d.encoding,vertexCountWithoutSkirts:d.vertexCountWithoutSkirts,indexCountWithoutSkirts:d.indexCountWithoutSkirts,westIndicesSouthToNorth:d.westIndicesSouthToNorth,southIndicesEastToWest:d.southIndicesEastToWest,eastIndicesNorthToSouth:d.eastIndicesNorthToSouth,northIndicesWestToEast:d.northIndicesWestToEast}}))})); |
@@ -1,3 +0,3 @@ | ||
define(["./Matrix2-e6265fb0","./AxisAlignedBoundingBox-5ba8fa79","./Transforms-06c05e21","./defaultValue-69ee94f4","./RuntimeError-ac440aa5","./TerrainEncoding-7f4829f1","./ComponentDatatype-a9820060","./OrientedBoundingBox-0f36ec8f","./WebMercatorProjection-50f5da31","./_commonjsHelpers-3aae1032-15991586","./createTaskProcessorWorker","./combine-0259f56f","./AttributeCompression-6e71d14f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p){"use strict";var x=Object.freeze({NONE:0,LERC:1});const w={};w.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const k=new e.Cartesian3,y=new e.Matrix4,I=new e.Cartesian3,b=new e.Cartesian3;w.computeVertices=function(n){const f=Math.cos,u=Math.sin,c=Math.sqrt,d=Math.atan,h=Math.exp,m=s.CesiumMath.PI_OVER_TWO,g=s.CesiumMath.toRadians,p=n.heightmap,x=n.width,U=n.height,T=n.skirtHeight,M=T>0,V=a.defaultValue(n.isGeographic,!0),v=a.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84),A=1/v.maximumRadius,B=e.Rectangle.clone(n.nativeRectangle),D=e.Rectangle.clone(n.rectangle);let S,P,E,C;a.defined(D)?(S=D.west,P=D.south,E=D.east,C=D.north):V?(S=g(B.west),P=g(B.south),E=g(B.east),C=g(B.north)):(S=B.west*A,P=m-2*d(h(-B.south*A)),E=B.east*A,C=m-2*d(h(-B.north*A)));let F=n.relativeToCenter;const N=a.defined(F);F=N?F:e.Cartesian3.ZERO;const O=a.defaultValue(n.includeWebMercatorT,!1),R=a.defaultValue(n.exaggeration,1),L=a.defaultValue(n.exaggerationRelativeHeight,0),z=1!==R,H=a.defaultValue(n.structure,w.DEFAULT_STRUCTURE),_=a.defaultValue(H.heightScale,w.DEFAULT_STRUCTURE.heightScale),Y=a.defaultValue(H.heightOffset,w.DEFAULT_STRUCTURE.heightOffset),W=a.defaultValue(H.elementsPerHeight,w.DEFAULT_STRUCTURE.elementsPerHeight),X=a.defaultValue(H.stride,w.DEFAULT_STRUCTURE.stride),Z=a.defaultValue(H.elementMultiplier,w.DEFAULT_STRUCTURE.elementMultiplier),j=a.defaultValue(H.isBigEndian,w.DEFAULT_STRUCTURE.isBigEndian);let G=e.Rectangle.computeWidth(B),q=e.Rectangle.computeHeight(B);const Q=G/(x-1),J=q/(U-1);V||(G*=A,q*=A);const K=v.radiiSquared,$=K.x,ee=K.y,te=K.z;let ie=65536,ae=-65536;const ne=i.Transforms.eastNorthUpToFixedFrame(F,v),re=e.Matrix4.inverseTransformation(ne,y);let se,le;O&&(se=o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(P),le=1/(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(C)-se));const oe=I;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;const fe=b;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;let ue=Number.POSITIVE_INFINITY;const ce=x*U,de=ce+(T>0?2*x+2*U:0),he=new Array(de),me=new Array(de),ge=new Array(de),pe=O?new Array(de):[],xe=z?new Array(de):[];let we=0,ke=U,ye=0,Ie=x;M&&(--we,++ke,--ye,++Ie);const be=1e-5;for(let t=we;t<ke;++t){let i=t;i<0&&(i=0),i>=U&&(i=U-1);let a=B.north-J*i;a=V?g(a):m-2*d(h(-a*A));let n=(a-P)/(C-P);n=s.CesiumMath.clamp(n,0,1);const r=t===we,l=t===ke-1;T>0&&(r?a+=be*q:l&&(a-=be*q));const w=f(a),y=u(a),I=te*y;let b;O&&(b=(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a)-se)*le);for(let t=ye;t<Ie;++t){let a=t;a<0&&(a=0),a>=x&&(a=x-1);const o=i*(x*X)+a*X;let d;if(1===W)d=p[o];else{let e;if(d=0,j)for(e=0;e<W;++e)d=d*Z+p[o+e];else for(e=W-1;e>=0;--e)d=d*Z+p[o+e]}d=d*_+Y,ae=Math.max(ae,d),ie=Math.min(ie,d);let h=B.west+Q*a;V?h=g(h):h*=A;let m=(h-S)/(E-S);m=s.CesiumMath.clamp(m,0,1);let M=i*x+a;if(T>0){const e=t===ye,n=t===Ie-1,s=r||l||e||n;if((r||l)&&(e||n))continue;s&&(d-=T,e?(M=ce+(U-i-1),h-=be*G):l?M=ce+U+(x-a-1):n?(M=ce+U+x+i,h+=be*G):r&&(M=ce+U+x+U+a))}const D=w*f(h),P=w*u(h),C=$*D,F=ee*P,N=1/c(C*D+F*P+I*y),R=C*N,L=F*N,H=I*N,q=new e.Cartesian3;q.x=R+D*d,q.y=L+P*d,q.z=H+y*d,e.Matrix4.multiplyByPoint(re,q,k),e.Cartesian3.minimumByComponent(k,oe,oe),e.Cartesian3.maximumByComponent(k,fe,fe),ue=Math.min(ue,d),he[M]=q,ge[M]=new e.Cartesian2(m,n),me[M]=d,O&&(pe[M]=b),z&&(xe[M]=v.geodeticSurfaceNormal(q))}}const Ue=i.BoundingSphere.fromPoints(he);let Te,Me;if(a.defined(D)&&(Te=l.OrientedBoundingBox.fromRectangle(D,ie,ae,v)),N){Me=new r.EllipsoidalOccluder(v).computeHorizonCullingPointPossiblyUnderEllipsoid(F,he,ie)}const Ve=new t.AxisAlignedBoundingBox(oe,fe,F),ve=new r.TerrainEncoding(F,Ve,ue,ae,ne,!1,O,z,R,L),Ae=new Float32Array(de*ve.stride);let Be=0;for(let e=0;e<de;++e)Be=ve.encode(Ae,Be,he[e],ge[e],me[e],void 0,pe[e],xe[e]);return{vertices:Ae,maximumHeight:ae,minimumHeight:ie,encoding:ve,boundingSphere3D:Ue,orientedBoundingBox:Te,occludeePointInScaledSpace:Me}};var U=f.createCommonjsModule((function(e){ | ||
define(["./Matrix2-1ba2543c","./AxisAlignedBoundingBox-dd1e93db","./Transforms-fdc0a95d","./defaultValue-69ee94f4","./RuntimeError-ac440aa5","./TerrainEncoding-365ddcc9","./ComponentDatatype-07fbb0d4","./OrientedBoundingBox-966209b7","./WebMercatorProjection-7e95daf8","./_commonjsHelpers-3aae1032-15991586","./createTaskProcessorWorker","./combine-0259f56f","./AttributeCompression-4c4a8822","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p){"use strict";var x=Object.freeze({NONE:0,LERC:1});const w={};w.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const k=new e.Cartesian3,y=new e.Matrix4,I=new e.Cartesian3,b=new e.Cartesian3;w.computeVertices=function(n){const f=Math.cos,u=Math.sin,c=Math.sqrt,d=Math.atan,h=Math.exp,m=s.CesiumMath.PI_OVER_TWO,g=s.CesiumMath.toRadians,p=n.heightmap,x=n.width,U=n.height,T=n.skirtHeight,M=T>0,V=a.defaultValue(n.isGeographic,!0),v=a.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84),A=1/v.maximumRadius,B=e.Rectangle.clone(n.nativeRectangle),D=e.Rectangle.clone(n.rectangle);let S,P,E,C;a.defined(D)?(S=D.west,P=D.south,E=D.east,C=D.north):V?(S=g(B.west),P=g(B.south),E=g(B.east),C=g(B.north)):(S=B.west*A,P=m-2*d(h(-B.south*A)),E=B.east*A,C=m-2*d(h(-B.north*A)));let F=n.relativeToCenter;const N=a.defined(F);F=N?F:e.Cartesian3.ZERO;const O=a.defaultValue(n.includeWebMercatorT,!1),R=a.defaultValue(n.exaggeration,1),L=a.defaultValue(n.exaggerationRelativeHeight,0),z=1!==R,H=a.defaultValue(n.structure,w.DEFAULT_STRUCTURE),_=a.defaultValue(H.heightScale,w.DEFAULT_STRUCTURE.heightScale),Y=a.defaultValue(H.heightOffset,w.DEFAULT_STRUCTURE.heightOffset),W=a.defaultValue(H.elementsPerHeight,w.DEFAULT_STRUCTURE.elementsPerHeight),X=a.defaultValue(H.stride,w.DEFAULT_STRUCTURE.stride),Z=a.defaultValue(H.elementMultiplier,w.DEFAULT_STRUCTURE.elementMultiplier),j=a.defaultValue(H.isBigEndian,w.DEFAULT_STRUCTURE.isBigEndian);let G=e.Rectangle.computeWidth(B),q=e.Rectangle.computeHeight(B);const Q=G/(x-1),J=q/(U-1);V||(G*=A,q*=A);const K=v.radiiSquared,$=K.x,ee=K.y,te=K.z;let ie=65536,ae=-65536;const ne=i.Transforms.eastNorthUpToFixedFrame(F,v),re=e.Matrix4.inverseTransformation(ne,y);let se,le;O&&(se=o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(P),le=1/(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(C)-se));const oe=I;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;const fe=b;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;let ue=Number.POSITIVE_INFINITY;const ce=x*U,de=ce+(T>0?2*x+2*U:0),he=new Array(de),me=new Array(de),ge=new Array(de),pe=O?new Array(de):[],xe=z?new Array(de):[];let we=0,ke=U,ye=0,Ie=x;M&&(--we,++ke,--ye,++Ie);const be=1e-5;for(let t=we;t<ke;++t){let i=t;i<0&&(i=0),i>=U&&(i=U-1);let a=B.north-J*i;a=V?g(a):m-2*d(h(-a*A));let n=(a-P)/(C-P);n=s.CesiumMath.clamp(n,0,1);const r=t===we,l=t===ke-1;T>0&&(r?a+=be*q:l&&(a-=be*q));const w=f(a),y=u(a),I=te*y;let b;O&&(b=(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a)-se)*le);for(let t=ye;t<Ie;++t){let a=t;a<0&&(a=0),a>=x&&(a=x-1);const o=i*(x*X)+a*X;let d;if(1===W)d=p[o];else{let e;if(d=0,j)for(e=0;e<W;++e)d=d*Z+p[o+e];else for(e=W-1;e>=0;--e)d=d*Z+p[o+e]}d=d*_+Y,ae=Math.max(ae,d),ie=Math.min(ie,d);let h=B.west+Q*a;V?h=g(h):h*=A;let m=(h-S)/(E-S);m=s.CesiumMath.clamp(m,0,1);let M=i*x+a;if(T>0){const e=t===ye,n=t===Ie-1,s=r||l||e||n;if((r||l)&&(e||n))continue;s&&(d-=T,e?(M=ce+(U-i-1),h-=be*G):l?M=ce+U+(x-a-1):n?(M=ce+U+x+i,h+=be*G):r&&(M=ce+U+x+U+a))}const D=w*f(h),P=w*u(h),C=$*D,F=ee*P,N=1/c(C*D+F*P+I*y),R=C*N,L=F*N,H=I*N,q=new e.Cartesian3;q.x=R+D*d,q.y=L+P*d,q.z=H+y*d,e.Matrix4.multiplyByPoint(re,q,k),e.Cartesian3.minimumByComponent(k,oe,oe),e.Cartesian3.maximumByComponent(k,fe,fe),ue=Math.min(ue,d),he[M]=q,ge[M]=new e.Cartesian2(m,n),me[M]=d,O&&(pe[M]=b),z&&(xe[M]=v.geodeticSurfaceNormal(q))}}const Ue=i.BoundingSphere.fromPoints(he);let Te,Me;if(a.defined(D)&&(Te=l.OrientedBoundingBox.fromRectangle(D,ie,ae,v)),N){Me=new r.EllipsoidalOccluder(v).computeHorizonCullingPointPossiblyUnderEllipsoid(F,he,ie)}const Ve=new t.AxisAlignedBoundingBox(oe,fe,F),ve=new r.TerrainEncoding(F,Ve,ue,ae,ne,!1,O,z,R,L),Ae=new Float32Array(de*ve.stride);let Be=0;for(let e=0;e<de;++e)Be=ve.encode(Ae,Be,he[e],ge[e],me[e],void 0,pe[e],xe[e]);return{vertices:Ae,maximumHeight:ae,minimumHeight:ie,encoding:ve,boundingSphere3D:Ue,orientedBoundingBox:Te,occludeePointInScaledSpace:Me}};var U=f.createCommonjsModule((function(e){ | ||
/* Copyright 2015-2018 Esri. 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 @preserve */ | ||
!function(){var t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p,x=(t={defaultNoDataValue:-34027999387901484e22,decode:function(e,s){var l=(s=s||{}).encodedMaskData||null===s.encodedMaskData,o=r(e,s.inputOffset||0,l),f=null!==s.noDataValue?s.noDataValue:t.defaultNoDataValue,u=i(o,s.pixelType||Float32Array,s.encodedMaskData,f,s.returnMask),c={width:o.width,height:o.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:o.pixels.maxValue,noDataValue:f};return u.resultMask&&(c.maskData=u.resultMask),s.returnEncodedMask&&o.mask&&(c.encodedMaskData=o.mask.bitset?o.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=a(o),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(o))),c}},i=function(e,t,i,a,n){var r,l,o,f=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),m=2*e.maxZError,g=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),l=new t(e.width*e.height),n&&i&&(o=new Uint8Array(e.width*e.height));for(var p,x,w=new Float32Array(d*h),k=0;k<=c;k++){var y=k!==c?h:e.height%c;if(0!==y)for(var I=0;I<=u;I++){var b=I!==u?d:e.width%u;if(0!==b){var U,T,M,V,v=k*e.width*h+I*d,A=e.width-b,B=e.pixels.blocks[f];if(B.encoding<2?(0===B.encoding?U=B.rawData:(s(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,m,w,e.pixels.maxValue),U=w),T=0):M=2===B.encoding?0:B.offset,i)for(x=0;x<y;x++){for(7&v&&(V=i[v>>3],V<<=7&v),p=0;p<b;p++)7&v||(V=i[v>>3]),128&V?(o&&(o[v]=1),g=g>(r=B.encoding<2?U[T++]:M)?r:g,l[v++]=r):(o&&(o[v]=0),l[v++]=a),V<<=1;v+=A}else if(B.encoding<2)for(x=0;x<y;x++){for(p=0;p<b;p++)g=g>(r=U[T++])?r:g,l[v++]=r;v+=A}else for(g=g>M?M:g,x=0;x<y;x++){for(p=0;p<b;p++)l[v++]=M;v+=A}if(1===B.encoding&&T!==B.numValidPixels)throw"Block and Mask do not match";f++}}}return{resultPixels:l,resultMask:o,minValue:g}},a=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},a=0;a<t;a++){var n=e.pixels.blocks[a];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},r=function(e,t,i){var a={},n=new Uint8Array(e,t,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;t+=10;var r=new DataView(e,t,24);if(a.fileVersion=r.getInt32(0,!0),a.imageType=r.getInt32(4,!0),a.height=r.getUint32(8,!0),a.width=r.getUint32(12,!0),a.maxZError=r.getFloat64(16,!0),t+=24,!i)if(r=new DataView(e,t,16),a.mask={},a.mask.numBlocksY=r.getUint32(0,!0),a.mask.numBlocksX=r.getUint32(4,!0),a.mask.numBytes=r.getUint32(8,!0),a.mask.maxValue=r.getFloat32(12,!0),t+=16,a.mask.numBytes>0){var s=new Uint8Array(Math.ceil(a.width*a.height/8)),l=(r=new DataView(e,t,a.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(l>0)for(;l--;)s[f++]=r.getUint8(o++);else{var u=r.getUint8(o++);for(l=-l;l--;)s[f++]=u}l=r.getInt16(o,!0),o+=2}while(o<a.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=s,t+=a.mask.numBytes}else 0==(a.mask.numBytes|a.mask.numBlocksY|a.mask.maxValue)&&(a.mask.bitset=new Uint8Array(Math.ceil(a.width*a.height/8)));r=new DataView(e,t,16),a.pixels={},a.pixels.numBlocksY=r.getUint32(0,!0),a.pixels.numBlocksX=r.getUint32(4,!0),a.pixels.numBytes=r.getUint32(8,!0),a.pixels.maxValue=r.getFloat32(12,!0),t+=16;var c=a.pixels.numBlocksX,d=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),m=d+(a.height%d>0?1:0);a.pixels.blocks=new Array(h*m);for(var g=0,p=0;p<m;p++)for(var x=0;x<h;x++){var w=0,k=e.byteLength-t;r=new DataView(e,t,Math.min(10,k));var y={};a.pixels.blocks[g++]=y;var I=r.getUint8(0);if(w++,y.encoding=63&I,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==I&&2!==I){if(I>>=6,y.offsetType=I,2===I)y.offset=r.getInt8(1),w++;else if(1===I)y.offset=r.getInt16(1,!0),w+=2;else{if(0!==I)throw"Invalid block offset type";y.offset=r.getFloat32(1,!0),w+=4}if(1===y.encoding)if(I=r.getUint8(w),w++,y.bitsPerPixel=63&I,I>>=6,y.numValidPixelsType=I,2===I)y.numValidPixels=r.getUint8(w),w++;else if(1===I)y.numValidPixels=r.getUint16(w,!0),w+=2;else{if(0!==I)throw"Invalid valid pixel count type";y.numValidPixels=r.getUint32(w,!0),w+=4}}var b;if(t+=w,3!==y.encoding)if(0===y.encoding){var U=(a.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*U),new Uint8Array(b).set(new Uint8Array(e,t,4*U));var T=new Float32Array(b);y.rawData=T,t+=4*U}else if(1===y.encoding){var M=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),V=Math.ceil(M/4);b=new ArrayBuffer(4*V),new Uint8Array(b).set(new Uint8Array(e,t,M)),y.stuffedData=new Uint32Array(b),t+=M}}else t++}return a.eofOffset=t,a},s=function(e,t,i,a,n,r,s){var l,o,f,u=(1<<t)-1,c=0,d=0,h=Math.ceil((s-a)/n),m=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*m,l=0;l<i;l++){if(0===d&&(f=e[c++],d=32),d>=t)o=f>>>d-t&u,d-=t;else{var g=t-d;o=(f&u)<<g&u,o+=(f=e[c++])>>>(d=32-g)}r[l]=o<h?a+o*n:s}return r},t),w=(l=function(e,t,i,a,n,r,s,l){var o,f,u,c,d,h=(1<<i)-1,m=0,g=0,p=4*e.length-Math.ceil(i*a/8);if(e[e.length-1]<<=8*p,n)for(o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=n[f];else for(d=Math.ceil((l-r)/s),o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?r+f*s:l},o=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;var g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32),c>=t?(d=s>>>c-t&l,c-=t):(d=(s&l)<<(u=t-c)&l,d+=(s=e[o++])>>>(c=32-u)),h[f]=d<g?a+d*n:r;return h.unshift(a),h},f=function(e,t,i,a,n,r,s,l){var o,f,u,c,d=(1<<i)-1,h=0,m=0,g=0;if(n)for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=n[f];else{var p=Math.ceil((l-r)/s);for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=f<p?r+f*s:l}return t},u=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32,h=0),c>=t?(d=s>>>h&l,c-=t,h+=t):(d=s>>>h&l,c=32-(u=t-c),d|=((s=e[o++])&(1<<u)-1)<<t-u,h=u),m[f]=d<g?a+d*n:r;return m.unshift(a),m},c=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=4*e.length-Math.ceil(i*a/8);for(e[e.length-1]<<=8*c,n=0;n<a;n++)0===u&&(s=e[f++],u=32),u>=i?(r=s>>>u-i&o,u-=i):(r=(s&o)<<(l=i-u)&o,r+=(s=e[f++])>>>(u=32-l)),t[n]=r;return t},d=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=0;for(n=0;n<a;n++)0===u&&(s=e[f++],u=32,c=0),u>=i?(r=s>>>c&o,u-=i,c+=i):(r=s>>>c&o,u=32-(l=i-u),r|=((s=e[f++])&(1<<l)-1)<<i-l,c=l),t[n]=r;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,a=e.length,n=Math.floor(a/2),r=0;n;){var s=n>=359?359:n;n-=s;do{t+=e[r++]<<8,i+=t+=e[r++]}while(--s);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&a&&(i+=t+=e[r]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,a=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,a),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var r,s=new DataView(e,i,8),l=s.getInt32(0,!0);if(n.fileVersion=l,i+=4,l>=3&&(n.checksum=s.getUint32(4,!0),i+=4),s=new DataView(e,i,12),n.height=s.getUint32(0,!0),n.width=s.getUint32(4,!0),i+=8,l>=4?(n.numDims=s.getUint32(8,!0),i+=4):n.numDims=1,s=new DataView(e,i,40),n.numValidPixel=s.getUint32(0,!0),n.microBlockSize=s.getInt32(4,!0),n.blobSize=s.getInt32(8,!0),n.imageType=s.getInt32(12,!0),n.maxZError=s.getFloat64(16,!0),n.zMin=s.getFloat64(24,!0),n.zMax=s.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,l>=3&&(r=l>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,a=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),r=this.readSubArray(e,t.ptr,a,n),s=this.readSubArray(e,t.ptr+n,a,n);t.ptr+=2*n;var l,o=!0;for(l=0;l<i.numDims;l++)if(r[l]!==s[l]){o=!1;break}return i.minValues=r,i.maxValues=s,o},readSubArray:function(e,t,i,a){var n;if(i===Uint8Array)n=new Uint8Array(e,t,a);else{var r=new ArrayBuffer(a);new Uint8Array(r).set(new Uint8Array(e,t,a)),n=new i(r)}return n},readMask:function(e,t){var i,a,n=t.ptr,r=t.headerInfo,s=r.width*r.height,l=r.numValidPixel,o=new DataView(e,n,4),f={};if(f.numBytes=o.getUint32(0,!0),n+=4,(0===l||s===l)&&0!==f.numBytes)throw"invalid mask";if(0===l)i=new Uint8Array(Math.ceil(s/8)),f.bitset=i,a=new Uint8Array(s),t.pixels.resultMask=a,n+=f.numBytes;else if(f.numBytes>0){i=new Uint8Array(Math.ceil(s/8));var u=(o=new DataView(e,n,f.numBytes)).getInt16(0,!0),c=2,d=0,h=0;do{if(u>0)for(;u--;)i[d++]=o.getUint8(c++);else for(h=o.getUint8(c++),u=-u;u--;)i[d++]=h;u=o.getInt16(c,!0),c+=2}while(c<f.numBytes);if(-32768!==u||d<i.length)throw"Unexpected end of mask RLE encoding";a=new Uint8Array(s);var m=0,g=0;for(g=0;g<s;g++)7&g?(m=i[g>>3],m<<=7&g):m=i[g>>3],128&m&&(a[g]=1);t.pixels.resultMask=a,f.bitset=i,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,i){var a,n=t.ptr,r=t.headerInfo,s=r.numDims,l=r.width*r.height,o=r.imageType,f=r.numValidPixel*h.getDataTypeSize(o)*s,u=t.pixels.resultMask;if(i===Uint8Array)a=new Uint8Array(e,n,f);else{var c=new ArrayBuffer(f);new Uint8Array(c).set(new Uint8Array(e,n,f)),a=new i(c)}if(a.length===l*s)t.pixels.resultPixels=a;else{t.pixels.resultPixels=new i(l*s);var d=0,m=0,g=0,p=0;if(s>1)for(g=0;g<s;g++)for(p=g*l,m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[p+m]=a[d++]);else for(m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[m]=a[d++])}return n+=f,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(e,t.ptr,16);if(t.ptr+=16,a.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=a.getInt32(4,!0),r=a.getInt32(8,!0),s=a.getInt32(12,!0);if(r>=s)return!1;var l=new Uint32Array(s-r);h.decodeBits(e,t,l);var o,f,u,c,d=[];for(o=r;o<s;o++)d[f=o-(o<n?0:n)]={first:l[o-r],second:null};var g=e.byteLength-t.ptr,p=Math.ceil(g/4),x=new ArrayBuffer(4*p);new Uint8Array(x).set(new Uint8Array(e,t.ptr,g));var w,k=new Uint32Array(x),y=0,I=0;for(w=k[0],o=r;o<s;o++)(c=d[f=o-(o<n?0:n)].first)>0&&(d[f].second=w<<y>>>32-c,32-y>=c?32===(y+=c)&&(y=0,w=k[++I]):(y+=c-32,w=k[++I],d[f].second|=w>>>32-y));var b=0,U=0,T=new m;for(o=0;o<d.length;o++)void 0!==d[o]&&(b=Math.max(b,d[o].first));U=b>=i?i:b,b>=30&&console.log("WARning, large NUM LUT BITS IS "+b);var M,V,v,A,B,D=[];for(o=r;o<s;o++)if((c=d[f=o-(o<n?0:n)].first)>0)if(M=[c,f],c<=U)for(V=d[f].second<<U-c,v=1<<U-c,u=0;u<v;u++)D[V|u]=M;else for(V=d[f].second,B=T,A=c-1;A>=0;A--)V>>>A&1?(B.right||(B.right=new m),B=B.right):(B.left||(B.left=new m),B=B.left),0!==A||B.val||(B.val=M[1]);return{decodeLut:D,numBitsLUTQick:U,numBitsLUT:b,tree:T,stuffedData:k,srcPtr:I,bitPos:y}},readHuffman:function(e,t,i){var a,n,r,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,x=this.readHuffmanTree(e,t),w=x.decodeLut,k=x.tree,y=x.stuffedData,I=x.srcPtr,b=x.bitPos,U=x.numBitsLUTQick,T=x.numBitsLUT,M=0===t.headerInfo.imageType?128:0,V=t.pixels.resultMask,v=0;b>0&&(I++,b=0);var A,B=y[I],D=1===t.encodeMode,S=new i(p*h),P=S;for(A=0;A<d.numDims;A++){if(h>1&&(P=new i(S.buffer,p*A,p),v=0),t.headerInfo.numValidPixel===g*m)for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(r+=f>0?v:o>0?P[u-g]:v,r&=255,P[u]=r,v=r):P[u]=r}else for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++)if(V[u]){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(f>0&&V[u-1]?r+=v:o>0&&V[u-g]?r+=P[u-g]:r+=v,r&=255,P[u]=r,v=r):P[u]=r}t.ptr=t.ptr+4*(I+1)+(b>0?4:0)}t.pixels.resultPixels=S},decodeBits:function(e,t,i,a,n){var r=t.headerInfo,s=r.fileVersion,h=0,m=new DataView(e,t.ptr,5),g=m.getUint8(0);h++;var p=g>>6,x=0===p?4:3-p,w=(32&g)>0,k=31&g,y=0;if(1===x)y=m.getUint8(h),h++;else if(2===x)y=m.getUint16(h,!0),h+=2;else{if(4!==x)throw"Invalid valid pixel count type";y=m.getUint32(h,!0),h+=4}var I,b,U,T,M,V,v,A,B,D=2*r.maxZError,S=r.numDims>1?r.maxValues[n]:r.zMax;if(w){for(t.counter.lut++,A=m.getUint8(h),h++,T=Math.ceil((A-1)*k/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),U=new Uint8Array(b),t.ptr+=h,U.set(new Uint8Array(e,t.ptr,T)),v=new Uint32Array(b),t.ptr+=T,B=0;A-1>>>B;)B++;T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,V=s>=3?u(v,k,A-1,a,D,S):o(v,k,A-1,a,D,S),s>=3?f(I,i,B,y,V):l(I,i,B,y,V)}else t.counter.bitstuffer++,B=k,t.ptr+=h,B>0&&(T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,s>=3?null==a?d(I,i,B,y):f(I,i,B,y,!1,a,D,S):null==a?c(I,i,B,y):l(I,i,B,y,!1,a,D,S))},readTiles:function(e,t,i){var a=t.headerInfo,n=a.width,r=a.height,s=a.microBlockSize,l=a.imageType,o=h.getDataTypeSize(l),f=Math.ceil(n/s),u=Math.ceil(r/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f,t.pixels.ptr=0;var c,d,m,g,p,x,w,k,y=0,I=0,b=0,U=0,T=0,M=0,V=0,v=0,A=0,B=0,D=0,S=0,P=0,E=0,C=0,F=new i(s*s),N=r%s||s,O=n%s||s,R=a.numDims,L=t.pixels.resultMask,z=t.pixels.resultPixels;for(b=0;b<u;b++)for(T=b!==u-1?s:N,U=0;U<f;U++)for(B=b*n*s+U*s,D=n-(M=U!==f-1?s:O),k=0;k<R;k++){if(R>1&&(z=new i(t.pixels.resultPixels.buffer,n*r*k*o,n*r)),V=e.byteLength-t.ptr,d={},C=0,C++,A=(v=(c=new DataView(e,t.ptr,Math.min(10,V))).getUint8(0))>>6&255,(v>>2&15)!=(U*s>>3&15))throw"integrity issue";if((p=3&v)>3)throw t.ptr+=C,"Invalid block encoding ("+p+")";if(2!==p)if(0===p){if(t.counter.uncompressed++,t.ptr+=C,S=(S=T*M*o)<(P=e.byteLength-t.ptr)?S:P,m=new ArrayBuffer(S%o==0?S:S+o-S%o),new Uint8Array(m).set(new Uint8Array(e,t.ptr,S)),g=new i(m),E=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=g[E++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=g[E++];B+=D}t.ptr+=E*o}else if(x=h.getDataTypeUsed(l,A),w=h.getOnePixel(d,C,x,c),C+=h.getDataTypeSize(x),3===p)if(t.ptr+=C,t.counter.constantoffset++,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=w),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=w;B+=D}else if(t.ptr+=C,h.decodeBits(e,t,F,w,k),C=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=F[C++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=F[C++];B+=D}else t.counter.constant++,t.ptr+=C}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,n=a*i,r=0,s=0,l=0,o=e.pixels.resultMask;if(o)if(i>1)for(r=0;r<i;r++)for(l=r*a,s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[l+s]=t);else for(s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[s]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(s=0;s<n;s++)e.pixels.resultPixels[s]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,a){var n=0;switch(i){case 0:n=a.getInt8(t);break;case 1:n=a.getUint8(t);break;case 2:n=a.getInt16(t,!0);break;case 3:n=a.getUint16(t,!0);break;case 4:n=a.getInt32(t,!0);break;case 5:n=a.getUInt32(t,!0);break;case 6:n=a.getFloat32(t,!0);break;case 7:n=a.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},m=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,a=0,n={};n.ptr=t.inputOffset||0,n.pixels={},h.readHeaderInfo(e,n);var r=n.headerInfo,s=r.fileVersion,l=h.getDataTypeArray(r.imageType);h.readMask(e,n),r.numValidPixel===r.width*r.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var o,f=r.width*r.height;if(n.pixels.resultPixels=new l(f*r.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==r.numValidPixel)if(r.zMax===r.zMin)h.constructConstantSurface(n);else if(s>=4&&h.checkMinMaxRanges(e,n))h.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),c=u.getUint8(0);if(n.ptr++,c)h.readDataOneSweep(e,n,l);else if(s>1&&r.imageType<=1&&Math.abs(r.maxZError-.5)<1e-5){var d=u.getUint8(1);if(n.ptr++,n.encodeMode=d,d>2||s<4&&d>1)throw"Invalid Huffman flag "+d;d?h.readHuffman(e,n,l):h.readTiles(e,n,l)}else h.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(o=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(o)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(o=n.headerInfo.blobSize-n.ptr,Math.abs(o)>=1&&(n.eofOffset=n.headerInfo.blobSize));var m={width:r.width,height:r.height,pixelData:n.pixels.resultPixels,minValue:r.zMin,maxValue:r.zMax,validPixelCount:r.numValidPixel,dimCount:r.numDims,dimStats:{minValues:r.minValues,maxValues:r.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&h.isValidPixelValue(r.imageType,i)){var g=n.pixels.resultMask;for(a=0;a<f;a++)g[a]||(m.pixelData[a]=i);m.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(n)),m},getBandCount:function(e){for(var t=0,i=0,a={ptr:0,pixels:{}};i<e.byteLength-58;)h.readHeaderInfo(e,a),i+=a.headerInfo.blobSize,t++,a.ptr=i;return t}}),k=(g=new ArrayBuffer(4),p=new Uint8Array(g),new Uint32Array(g)[0]=1,1===p[0]),y={decode:function(e,t){if(!k)throw"Big endian system is not supported.";var i,a,n=(t=t||{}).inputOffset||0,r=new Uint8Array(e,n,10),s=String.fromCharCode.apply(null,r);if("CntZImage"===s.trim())i=x,a=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;i=w,a=2}for(var l,o,f,u,c,d,h=0,m=e.byteLength-10,g=[],p={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<m;){var y=i.decode(e,{inputOffset:n,encodedMaskData:l,maskData:f,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===h&&(l=y.encodedMaskData,f=y.maskData,p.width=y.width,p.height=y.height,p.dimCount=y.dimCount||1,p.pixelType=y.pixelType||y.fileInfo.pixelType,p.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),h++,p.pixels.push(y.pixelData),p.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(d=p.width*p.height,p.bandMasks=g,(f=new Uint8Array(d)).set(g[0]),u=1;u<g.length;u++)for(o=g[u],c=0;c<d;c++)f[c]=f[c]&o[c];p.maskData=f}return p}};e.exports?e.exports=y:this.Lerc=y}()}));return u((function(t,i){if(t.encoding===x.LERC){let e;try{e=U.decode(t.heightmap)}catch(e){throw new n.RuntimeError(e)}if(e.statistics[0].minValue===Number.MAX_VALUE)throw new n.RuntimeError("Invalid tile data");t.heightmap=e.pixels[0],t.width=e.width,t.height=e.height}t.ellipsoid=e.Ellipsoid.clone(t.ellipsoid),t.rectangle=e.Rectangle.clone(t.rectangle);const a=w.computeVertices(t),r=a.vertices;return i.push(r.buffer),{vertices:r.buffer,numberOfAttributes:a.encoding.stride,minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight,gridWidth:t.width,gridHeight:t.height,boundingSphere3D:a.boundingSphere3D,orientedBoundingBox:a.orientedBoundingBox,occludeePointInScaledSpace:a.occludeePointInScaledSpace,encoding:a.encoding,westIndicesSouthToNorth:a.westIndicesSouthToNorth,southIndicesEastToWest:a.southIndicesEastToWest,eastIndicesNorthToSouth:a.eastIndicesNorthToSouth,northIndicesWestToEast:a.northIndicesWestToEast}}))})); | ||
!function(){var t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p,x=(t={defaultNoDataValue:-34027999387901484e22,decode:function(e,s){var l=(s=s||{}).encodedMaskData||null===s.encodedMaskData,o=r(e,s.inputOffset||0,l),f=null!==s.noDataValue?s.noDataValue:t.defaultNoDataValue,u=i(o,s.pixelType||Float32Array,s.encodedMaskData,f,s.returnMask),c={width:o.width,height:o.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:o.pixels.maxValue,noDataValue:f};return u.resultMask&&(c.maskData=u.resultMask),s.returnEncodedMask&&o.mask&&(c.encodedMaskData=o.mask.bitset?o.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=a(o),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(o))),c}},i=function(e,t,i,a,n){var r,l,o,f=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),m=2*e.maxZError,g=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),l=new t(e.width*e.height),n&&i&&(o=new Uint8Array(e.width*e.height));for(var p,x,w=new Float32Array(d*h),k=0;k<=c;k++){var y=k!==c?h:e.height%c;if(0!==y)for(var I=0;I<=u;I++){var b=I!==u?d:e.width%u;if(0!==b){var U,T,M,V,v=k*e.width*h+I*d,A=e.width-b,B=e.pixels.blocks[f];if(B.encoding<2?(0===B.encoding?U=B.rawData:(s(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,m,w,e.pixels.maxValue),U=w),T=0):M=2===B.encoding?0:B.offset,i)for(x=0;x<y;x++){for(7&v&&(V=i[v>>3],V<<=7&v),p=0;p<b;p++)7&v||(V=i[v>>3]),128&V?(o&&(o[v]=1),g=g>(r=B.encoding<2?U[T++]:M)?r:g,l[v++]=r):(o&&(o[v]=0),l[v++]=a),V<<=1;v+=A}else if(B.encoding<2)for(x=0;x<y;x++){for(p=0;p<b;p++)g=g>(r=U[T++])?r:g,l[v++]=r;v+=A}else for(g=g>M?M:g,x=0;x<y;x++){for(p=0;p<b;p++)l[v++]=M;v+=A}if(1===B.encoding&&T!==B.numValidPixels)throw"Block and Mask do not match";f++}}}return{resultPixels:l,resultMask:o,minValue:g}},a=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},a=0;a<t;a++){var n=e.pixels.blocks[a];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},r=function(e,t,i){var a={},n=new Uint8Array(e,t,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;t+=10;var r=new DataView(e,t,24);if(a.fileVersion=r.getInt32(0,!0),a.imageType=r.getInt32(4,!0),a.height=r.getUint32(8,!0),a.width=r.getUint32(12,!0),a.maxZError=r.getFloat64(16,!0),t+=24,!i)if(r=new DataView(e,t,16),a.mask={},a.mask.numBlocksY=r.getUint32(0,!0),a.mask.numBlocksX=r.getUint32(4,!0),a.mask.numBytes=r.getUint32(8,!0),a.mask.maxValue=r.getFloat32(12,!0),t+=16,a.mask.numBytes>0){var s=new Uint8Array(Math.ceil(a.width*a.height/8)),l=(r=new DataView(e,t,a.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(l>0)for(;l--;)s[f++]=r.getUint8(o++);else{var u=r.getUint8(o++);for(l=-l;l--;)s[f++]=u}l=r.getInt16(o,!0),o+=2}while(o<a.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=s,t+=a.mask.numBytes}else 0==(a.mask.numBytes|a.mask.numBlocksY|a.mask.maxValue)&&(a.mask.bitset=new Uint8Array(Math.ceil(a.width*a.height/8)));r=new DataView(e,t,16),a.pixels={},a.pixels.numBlocksY=r.getUint32(0,!0),a.pixels.numBlocksX=r.getUint32(4,!0),a.pixels.numBytes=r.getUint32(8,!0),a.pixels.maxValue=r.getFloat32(12,!0),t+=16;var c=a.pixels.numBlocksX,d=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),m=d+(a.height%d>0?1:0);a.pixels.blocks=new Array(h*m);for(var g=0,p=0;p<m;p++)for(var x=0;x<h;x++){var w=0,k=e.byteLength-t;r=new DataView(e,t,Math.min(10,k));var y={};a.pixels.blocks[g++]=y;var I=r.getUint8(0);if(w++,y.encoding=63&I,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==I&&2!==I){if(I>>=6,y.offsetType=I,2===I)y.offset=r.getInt8(1),w++;else if(1===I)y.offset=r.getInt16(1,!0),w+=2;else{if(0!==I)throw"Invalid block offset type";y.offset=r.getFloat32(1,!0),w+=4}if(1===y.encoding)if(I=r.getUint8(w),w++,y.bitsPerPixel=63&I,I>>=6,y.numValidPixelsType=I,2===I)y.numValidPixels=r.getUint8(w),w++;else if(1===I)y.numValidPixels=r.getUint16(w,!0),w+=2;else{if(0!==I)throw"Invalid valid pixel count type";y.numValidPixels=r.getUint32(w,!0),w+=4}}var b;if(t+=w,3!==y.encoding)if(0===y.encoding){var U=(a.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*U),new Uint8Array(b).set(new Uint8Array(e,t,4*U));var T=new Float32Array(b);y.rawData=T,t+=4*U}else if(1===y.encoding){var M=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),V=Math.ceil(M/4);b=new ArrayBuffer(4*V),new Uint8Array(b).set(new Uint8Array(e,t,M)),y.stuffedData=new Uint32Array(b),t+=M}}else t++}return a.eofOffset=t,a},s=function(e,t,i,a,n,r,s){var l,o,f,u=(1<<t)-1,c=0,d=0,h=Math.ceil((s-a)/n),m=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*m,l=0;l<i;l++){if(0===d&&(f=e[c++],d=32),d>=t)o=f>>>d-t&u,d-=t;else{var g=t-d;o=(f&u)<<g&u,o+=(f=e[c++])>>>(d=32-g)}r[l]=o<h?a+o*n:s}return r},t),w=(l=function(e,t,i,a,n,r,s,l){var o,f,u,c,d,h=(1<<i)-1,m=0,g=0,p=4*e.length-Math.ceil(i*a/8);if(e[e.length-1]<<=8*p,n)for(o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=n[f];else for(d=Math.ceil((l-r)/s),o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?r+f*s:l},o=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;var g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32),c>=t?(d=s>>>c-t&l,c-=t):(d=(s&l)<<(u=t-c)&l,d+=(s=e[o++])>>>(c=32-u)),h[f]=d<g?a+d*n:r;return h.unshift(a),h},f=function(e,t,i,a,n,r,s,l){var o,f,u,c,d=(1<<i)-1,h=0,m=0,g=0;if(n)for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=n[f];else{var p=Math.ceil((l-r)/s);for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=f<p?r+f*s:l}return t},u=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32,h=0),c>=t?(d=s>>>h&l,c-=t,h+=t):(d=s>>>h&l,c=32-(u=t-c),d|=((s=e[o++])&(1<<u)-1)<<t-u,h=u),m[f]=d<g?a+d*n:r;return m.unshift(a),m},c=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=4*e.length-Math.ceil(i*a/8);for(e[e.length-1]<<=8*c,n=0;n<a;n++)0===u&&(s=e[f++],u=32),u>=i?(r=s>>>u-i&o,u-=i):(r=(s&o)<<(l=i-u)&o,r+=(s=e[f++])>>>(u=32-l)),t[n]=r;return t},d=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=0;for(n=0;n<a;n++)0===u&&(s=e[f++],u=32,c=0),u>=i?(r=s>>>c&o,u-=i,c+=i):(r=s>>>c&o,u=32-(l=i-u),r|=((s=e[f++])&(1<<l)-1)<<i-l,c=l),t[n]=r;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,a=e.length,n=Math.floor(a/2),r=0;n;){var s=n>=359?359:n;n-=s;do{t+=e[r++]<<8,i+=t+=e[r++]}while(--s);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&a&&(i+=t+=e[r]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,a=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,a),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var r,s=new DataView(e,i,8),l=s.getInt32(0,!0);if(n.fileVersion=l,i+=4,l>=3&&(n.checksum=s.getUint32(4,!0),i+=4),s=new DataView(e,i,12),n.height=s.getUint32(0,!0),n.width=s.getUint32(4,!0),i+=8,l>=4?(n.numDims=s.getUint32(8,!0),i+=4):n.numDims=1,s=new DataView(e,i,40),n.numValidPixel=s.getUint32(0,!0),n.microBlockSize=s.getInt32(4,!0),n.blobSize=s.getInt32(8,!0),n.imageType=s.getInt32(12,!0),n.maxZError=s.getFloat64(16,!0),n.zMin=s.getFloat64(24,!0),n.zMax=s.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,l>=3&&(r=l>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,a=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),r=this.readSubArray(e,t.ptr,a,n),s=this.readSubArray(e,t.ptr+n,a,n);t.ptr+=2*n;var l,o=!0;for(l=0;l<i.numDims;l++)if(r[l]!==s[l]){o=!1;break}return i.minValues=r,i.maxValues=s,o},readSubArray:function(e,t,i,a){var n;if(i===Uint8Array)n=new Uint8Array(e,t,a);else{var r=new ArrayBuffer(a);new Uint8Array(r).set(new Uint8Array(e,t,a)),n=new i(r)}return n},readMask:function(e,t){var i,a,n=t.ptr,r=t.headerInfo,s=r.width*r.height,l=r.numValidPixel,o=new DataView(e,n,4),f={};if(f.numBytes=o.getUint32(0,!0),n+=4,(0===l||s===l)&&0!==f.numBytes)throw"invalid mask";if(0===l)i=new Uint8Array(Math.ceil(s/8)),f.bitset=i,a=new Uint8Array(s),t.pixels.resultMask=a,n+=f.numBytes;else if(f.numBytes>0){i=new Uint8Array(Math.ceil(s/8));var u=(o=new DataView(e,n,f.numBytes)).getInt16(0,!0),c=2,d=0,h=0;do{if(u>0)for(;u--;)i[d++]=o.getUint8(c++);else for(h=o.getUint8(c++),u=-u;u--;)i[d++]=h;u=o.getInt16(c,!0),c+=2}while(c<f.numBytes);if(-32768!==u||d<i.length)throw"Unexpected end of mask RLE encoding";a=new Uint8Array(s);var m=0,g=0;for(g=0;g<s;g++)7&g?(m=i[g>>3],m<<=7&g):m=i[g>>3],128&m&&(a[g]=1);t.pixels.resultMask=a,f.bitset=i,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,i){var a,n=t.ptr,r=t.headerInfo,s=r.numDims,l=r.width*r.height,o=r.imageType,f=r.numValidPixel*h.getDataTypeSize(o)*s,u=t.pixels.resultMask;if(i===Uint8Array)a=new Uint8Array(e,n,f);else{var c=new ArrayBuffer(f);new Uint8Array(c).set(new Uint8Array(e,n,f)),a=new i(c)}if(a.length===l*s)t.pixels.resultPixels=a;else{t.pixels.resultPixels=new i(l*s);var d=0,m=0,g=0,p=0;if(s>1)for(g=0;g<s;g++)for(p=g*l,m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[p+m]=a[d++]);else for(m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[m]=a[d++])}return n+=f,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(e,t.ptr,16);if(t.ptr+=16,a.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=a.getInt32(4,!0),r=a.getInt32(8,!0),s=a.getInt32(12,!0);if(r>=s)return!1;var l=new Uint32Array(s-r);h.decodeBits(e,t,l);var o,f,u,c,d=[];for(o=r;o<s;o++)d[f=o-(o<n?0:n)]={first:l[o-r],second:null};var g=e.byteLength-t.ptr,p=Math.ceil(g/4),x=new ArrayBuffer(4*p);new Uint8Array(x).set(new Uint8Array(e,t.ptr,g));var w,k=new Uint32Array(x),y=0,I=0;for(w=k[0],o=r;o<s;o++)(c=d[f=o-(o<n?0:n)].first)>0&&(d[f].second=w<<y>>>32-c,32-y>=c?32===(y+=c)&&(y=0,w=k[++I]):(y+=c-32,w=k[++I],d[f].second|=w>>>32-y));var b=0,U=0,T=new m;for(o=0;o<d.length;o++)void 0!==d[o]&&(b=Math.max(b,d[o].first));U=b>=i?i:b,b>=30&&console.log("WARning, large NUM LUT BITS IS "+b);var M,V,v,A,B,D=[];for(o=r;o<s;o++)if((c=d[f=o-(o<n?0:n)].first)>0)if(M=[c,f],c<=U)for(V=d[f].second<<U-c,v=1<<U-c,u=0;u<v;u++)D[V|u]=M;else for(V=d[f].second,B=T,A=c-1;A>=0;A--)V>>>A&1?(B.right||(B.right=new m),B=B.right):(B.left||(B.left=new m),B=B.left),0!==A||B.val||(B.val=M[1]);return{decodeLut:D,numBitsLUTQick:U,numBitsLUT:b,tree:T,stuffedData:k,srcPtr:I,bitPos:y}},readHuffman:function(e,t,i){var a,n,r,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,x=this.readHuffmanTree(e,t),w=x.decodeLut,k=x.tree,y=x.stuffedData,I=x.srcPtr,b=x.bitPos,U=x.numBitsLUTQick,T=x.numBitsLUT,M=0===t.headerInfo.imageType?128:0,V=t.pixels.resultMask,v=0;b>0&&(I++,b=0);var A,B=y[I],D=1===t.encodeMode,S=new i(p*h),P=S;for(A=0;A<d.numDims;A++){if(h>1&&(P=new i(S.buffer,p*A,p),v=0),t.headerInfo.numValidPixel===g*m)for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(r+=f>0?v:o>0?P[u-g]:v,r&=255,P[u]=r,v=r):P[u]=r}else for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++)if(V[u]){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(f>0&&V[u-1]?r+=v:o>0&&V[u-g]?r+=P[u-g]:r+=v,r&=255,P[u]=r,v=r):P[u]=r}t.ptr=t.ptr+4*(I+1)+(b>0?4:0)}t.pixels.resultPixels=S},decodeBits:function(e,t,i,a,n){var r=t.headerInfo,s=r.fileVersion,h=0,m=new DataView(e,t.ptr,5),g=m.getUint8(0);h++;var p=g>>6,x=0===p?4:3-p,w=(32&g)>0,k=31&g,y=0;if(1===x)y=m.getUint8(h),h++;else if(2===x)y=m.getUint16(h,!0),h+=2;else{if(4!==x)throw"Invalid valid pixel count type";y=m.getUint32(h,!0),h+=4}var I,b,U,T,M,V,v,A,B,D=2*r.maxZError,S=r.numDims>1?r.maxValues[n]:r.zMax;if(w){for(t.counter.lut++,A=m.getUint8(h),h++,T=Math.ceil((A-1)*k/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),U=new Uint8Array(b),t.ptr+=h,U.set(new Uint8Array(e,t.ptr,T)),v=new Uint32Array(b),t.ptr+=T,B=0;A-1>>>B;)B++;T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,V=s>=3?u(v,k,A-1,a,D,S):o(v,k,A-1,a,D,S),s>=3?f(I,i,B,y,V):l(I,i,B,y,V)}else t.counter.bitstuffer++,B=k,t.ptr+=h,B>0&&(T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,s>=3?null==a?d(I,i,B,y):f(I,i,B,y,!1,a,D,S):null==a?c(I,i,B,y):l(I,i,B,y,!1,a,D,S))},readTiles:function(e,t,i){var a=t.headerInfo,n=a.width,r=a.height,s=a.microBlockSize,l=a.imageType,o=h.getDataTypeSize(l),f=Math.ceil(n/s),u=Math.ceil(r/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f,t.pixels.ptr=0;var c,d,m,g,p,x,w,k,y=0,I=0,b=0,U=0,T=0,M=0,V=0,v=0,A=0,B=0,D=0,S=0,P=0,E=0,C=0,F=new i(s*s),N=r%s||s,O=n%s||s,R=a.numDims,L=t.pixels.resultMask,z=t.pixels.resultPixels;for(b=0;b<u;b++)for(T=b!==u-1?s:N,U=0;U<f;U++)for(B=b*n*s+U*s,D=n-(M=U!==f-1?s:O),k=0;k<R;k++){if(R>1&&(z=new i(t.pixels.resultPixels.buffer,n*r*k*o,n*r)),V=e.byteLength-t.ptr,d={},C=0,C++,A=(v=(c=new DataView(e,t.ptr,Math.min(10,V))).getUint8(0))>>6&255,(v>>2&15)!=(U*s>>3&15))throw"integrity issue";if((p=3&v)>3)throw t.ptr+=C,"Invalid block encoding ("+p+")";if(2!==p)if(0===p){if(t.counter.uncompressed++,t.ptr+=C,S=(S=T*M*o)<(P=e.byteLength-t.ptr)?S:P,m=new ArrayBuffer(S%o==0?S:S+o-S%o),new Uint8Array(m).set(new Uint8Array(e,t.ptr,S)),g=new i(m),E=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=g[E++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=g[E++];B+=D}t.ptr+=E*o}else if(x=h.getDataTypeUsed(l,A),w=h.getOnePixel(d,C,x,c),C+=h.getDataTypeSize(x),3===p)if(t.ptr+=C,t.counter.constantoffset++,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=w),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=w;B+=D}else if(t.ptr+=C,h.decodeBits(e,t,F,w,k),C=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=F[C++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=F[C++];B+=D}else t.counter.constant++,t.ptr+=C}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,n=a*i,r=0,s=0,l=0,o=e.pixels.resultMask;if(o)if(i>1)for(r=0;r<i;r++)for(l=r*a,s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[l+s]=t);else for(s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[s]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(s=0;s<n;s++)e.pixels.resultPixels[s]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,a){var n=0;switch(i){case 0:n=a.getInt8(t);break;case 1:n=a.getUint8(t);break;case 2:n=a.getInt16(t,!0);break;case 3:n=a.getUint16(t,!0);break;case 4:n=a.getInt32(t,!0);break;case 5:n=a.getUInt32(t,!0);break;case 6:n=a.getFloat32(t,!0);break;case 7:n=a.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},m=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,a=0,n={};n.ptr=t.inputOffset||0,n.pixels={},h.readHeaderInfo(e,n);var r=n.headerInfo,s=r.fileVersion,l=h.getDataTypeArray(r.imageType);h.readMask(e,n),r.numValidPixel===r.width*r.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var o,f=r.width*r.height;if(n.pixels.resultPixels=new l(f*r.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==r.numValidPixel)if(r.zMax===r.zMin)h.constructConstantSurface(n);else if(s>=4&&h.checkMinMaxRanges(e,n))h.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),c=u.getUint8(0);if(n.ptr++,c)h.readDataOneSweep(e,n,l);else if(s>1&&r.imageType<=1&&Math.abs(r.maxZError-.5)<1e-5){var d=u.getUint8(1);if(n.ptr++,n.encodeMode=d,d>2||s<4&&d>1)throw"Invalid Huffman flag "+d;d?h.readHuffman(e,n,l):h.readTiles(e,n,l)}else h.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(o=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(o)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(o=n.headerInfo.blobSize-n.ptr,Math.abs(o)>=1&&(n.eofOffset=n.headerInfo.blobSize));var m={width:r.width,height:r.height,pixelData:n.pixels.resultPixels,minValue:r.zMin,maxValue:r.zMax,validPixelCount:r.numValidPixel,dimCount:r.numDims,dimStats:{minValues:r.minValues,maxValues:r.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&h.isValidPixelValue(r.imageType,i)){var g=n.pixels.resultMask;for(a=0;a<f;a++)g[a]||(m.pixelData[a]=i);m.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(n)),m},getBandCount:function(e){for(var t=0,i=0,a={ptr:0,pixels:{}};i<e.byteLength-58;)h.readHeaderInfo(e,a),i+=a.headerInfo.blobSize,t++,a.ptr=i;return t}}),k=(g=new ArrayBuffer(4),p=new Uint8Array(g),new Uint32Array(g)[0]=1,1===p[0]),y={decode:function(e,t){if(!k)throw"Big endian system is not supported.";var i,a,n=(t=t||{}).inputOffset||0,r=new Uint8Array(e,n,10),s=String.fromCharCode.apply(null,r);if("CntZImage"===s.trim())i=x,a=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;i=w,a=2}for(var l,o,f,u,c,d,h=0,m=e.byteLength-10,g=[],p={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<m;){var y=i.decode(e,{inputOffset:n,encodedMaskData:l,maskData:f,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===h&&(l=y.encodedMaskData,f=y.maskData,p.width=y.width,p.height=y.height,p.dimCount=y.dimCount||1,p.pixelType=y.pixelType||y.fileInfo.pixelType,p.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),h++,p.pixels.push(y.pixelData),p.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(d=p.width*p.height,p.bandMasks=g,(f=new Uint8Array(d)).set(g[0]),u=1;u<g.length;u++)for(o=g[u],c=0;c<d;c++)f[c]=f[c]&o[c];p.maskData=f}return p}};e.exports?e.exports=y:this.Lerc=y}()}));return u((function(t,i){if(t.encoding===x.LERC){let e;try{e=U.decode(t.heightmap)}catch(e){throw new n.RuntimeError(e)}if(e.statistics[0].minValue===Number.MAX_VALUE)throw new n.RuntimeError("Invalid tile data");t.heightmap=e.pixels[0],t.width=e.width,t.height=e.height}t.ellipsoid=e.Ellipsoid.clone(t.ellipsoid),t.rectangle=e.Rectangle.clone(t.rectangle);const a=w.computeVertices(t),r=a.vertices;return i.push(r.buffer),{vertices:r.buffer,numberOfAttributes:a.encoding.stride,minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight,gridWidth:t.width,gridHeight:t.height,boundingSphere3D:a.boundingSphere3D,orientedBoundingBox:a.orientedBoundingBox,occludeePointInScaledSpace:a.occludeePointInScaledSpace,encoding:a.encoding,westIndicesSouthToNorth:a.westIndicesSouthToNorth,southIndicesEastToWest:a.southIndicesEastToWest,eastIndicesNorthToSouth:a.eastIndicesNorthToSouth,northIndicesWestToEast:a.northIndicesWestToEast}}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./AxisAlignedBoundingBox-5ba8fa79","./Matrix2-e6265fb0","./defaultValue-69ee94f4","./TerrainEncoding-7f4829f1","./IndexDatatype-1cbc8622","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./Transforms-06c05e21","./WebMercatorProjection-50f5da31","./createTaskProcessorWorker","./AttributeCompression-6e71d14f","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I){"use strict";function g(){a.DeveloperError.throwInstantiationError()}Object.defineProperties(g.prototype,{errorEvent:{get:a.DeveloperError.throwInstantiationError},credit:{get:a.DeveloperError.throwInstantiationError},tilingScheme:{get:a.DeveloperError.throwInstantiationError},ready:{get:a.DeveloperError.throwInstantiationError},readyPromise:{get:a.DeveloperError.throwInstantiationError},hasWaterMask:{get:a.DeveloperError.throwInstantiationError},hasVertexNormals:{get:a.DeveloperError.throwInstantiationError},availability:{get:a.DeveloperError.throwInstantiationError}});const m=[];g.getRegularGridIndices=function(e,t){let n=m[e];r.defined(n)||(m[e]=n=[]);let o=n[t];return r.defined(o)||(o=e*t<i.CesiumMath.SIXTY_FOUR_KILOBYTES?n[t]=new Uint16Array((e-1)*(t-1)*6):n[t]=new Uint32Array((e-1)*(t-1)*6),p(e,t,o,0)),o};const T=[];g.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=T[e];r.defined(n)||(T[e]=n=[]);let o=n[t];if(!r.defined(o)){const r=g.getRegularGridIndices(e,t),i=E(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const f=[];function E(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function p(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function y(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}g.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=f[e];r.defined(n)||(f[e]=n=[]);let i=n[t];if(!r.defined(i)){const r=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=r+s,d=a+6*Math.max(0,s-4),h=E(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,m=h.northIndicesWestToEast,T=o.IndexDatatype.createTypedArray(c,d);p(e,t,T,0),g.addSkirtIndices(u,l,I,m,r,T,a),i=n[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:m,indexCountWithoutSkirts:a}}return i},g.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=y(e,s,i,a),s+=e.length,a=y(t,s,i,a),s+=t.length,a=y(r,s,i,a),s+=r.length,y(n,s,i,a)},g.heightmapTerrainQuality=.25,g.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*g.heightmapTerrainQuality/(t*r)},g.prototype.requestTileGeometry=a.DeveloperError.throwInstantiationError,g.prototype.getLevelMaximumGeometricError=a.DeveloperError.throwInstantiationError,g.prototype.getTileDataAvailable=a.DeveloperError.throwInstantiationError,g.prototype.loadTileDataAvailability=a.DeveloperError.throwInstantiationError;const N=32767,w=new t.Cartesian3,S=new t.Cartesian3,M=new t.Cartesian3,x=new t.Cartographic,b=new t.Cartesian2;function A(e,r,n,o,a,s,c,d,h){let u=Number.POSITIVE_INFINITY;const l=a.north,I=a.south;let g=a.east;const m=a.west;g<m&&(g+=i.CesiumMath.TWO_PI);const T=e.length;for(let a=0;a<T;++a){const T=e[a],f=n[T],E=o[T];x.longitude=i.CesiumMath.lerp(m,g,E.x),x.latitude=i.CesiumMath.lerp(I,l,E.y),x.height=f-r;const p=s.cartographicToCartesian(x,w);t.Matrix4.multiplyByPoint(c,p,p),t.Cartesian3.minimumByComponent(p,d,d),t.Cartesian3.maximumByComponent(p,h,h),u=Math.min(u,x.height)}return u}function C(e,t,n,o,a,s,d,h,u,l,I,g,m,T){const f=r.defined(d),E=u.north,p=u.south;let y=u.east;const N=u.west;y<N&&(y+=i.CesiumMath.TWO_PI);const S=n.length;for(let r=0;r<S;++r){const u=n[r],S=a[u],M=s[u];x.longitude=i.CesiumMath.lerp(N,y,M.x)+m,x.latitude=i.CesiumMath.lerp(p,E,M.y)+T,x.height=S-l;const A=h.cartographicToCartesian(x,w);if(f){const e=2*u;b.x=d[e],b.y=d[e+1]}let C,W;o.hasWebMercatorT&&(C=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(x.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=h.geodeticSurfaceNormal(A)),t=o.encode(e,t,A,M,x.height,b,C,W)}}function W(e,t){let n;return"function"==typeof e.slice&&(n=e.slice(),"function"!=typeof n.sort&&(n=void 0)),r.defined(n)||(n=Array.prototype.slice.call(e)),n.sort(t),n}return d((function(a,d){const h=a.quantizedVertices,u=h.length/3,l=a.octEncodedNormals,I=a.westIndices.length+a.eastIndices.length+a.southIndices.length+a.northIndices.length,m=a.includeWebMercatorT,T=a.exaggeration,f=a.exaggerationRelativeHeight,E=1!==T,p=t.Rectangle.clone(a.rectangle),y=p.west,v=p.south,P=p.east,D=p.north,k=t.Ellipsoid.clone(a.ellipsoid),F=a.minimumHeight,H=a.maximumHeight,_=a.relativeToCenter,G=s.Transforms.eastNorthUpToFixedFrame(_,k),V=t.Matrix4.inverseTransformation(G,new t.Matrix4);let Y,O;m&&(Y=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(v),O=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(D)-Y));const B=h.subarray(0,u),R=h.subarray(u,2*u),L=h.subarray(2*u,3*u),j=r.defined(l),U=new Array(u),z=new Array(u),q=new Array(u),Q=m?new Array(u):[],K=E?new Array(u):[],X=S;X.x=Number.POSITIVE_INFINITY,X.y=Number.POSITIVE_INFINITY,X.z=Number.POSITIVE_INFINITY;const Z=M;Z.x=Number.NEGATIVE_INFINITY,Z.y=Number.NEGATIVE_INFINITY,Z.z=Number.NEGATIVE_INFINITY;let J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,ee=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY;for(let e=0;e<u;++e){const r=B[e],n=R[e],o=r/N,a=n/N,s=i.CesiumMath.lerp(F,H,L[e]/N);x.longitude=i.CesiumMath.lerp(y,P,o),x.latitude=i.CesiumMath.lerp(v,D,a),x.height=s,J=Math.min(x.longitude,J),$=Math.max(x.longitude,$),ee=Math.min(x.latitude,ee),te=Math.max(x.latitude,te);const d=k.cartographicToCartesian(x);U[e]=new t.Cartesian2(o,a),z[e]=s,q[e]=d,m&&(Q[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(x.latitude)-Y)*O),E&&(K[e]=k.geodeticSurfaceNormal(d)),t.Matrix4.multiplyByPoint(V,d,w),t.Cartesian3.minimumByComponent(w,X,X),t.Cartesian3.maximumByComponent(w,Z,Z)}const re=W(a.westIndices,(function(e,t){return U[e].y-U[t].y})),ne=W(a.eastIndices,(function(e,t){return U[t].y-U[e].y})),oe=W(a.southIndices,(function(e,t){return U[t].x-U[e].x})),ie=W(a.northIndices,(function(e,t){return U[e].x-U[t].x}));let ae;if(F<0){ae=new n.EllipsoidalOccluder(k).computeHorizonCullingPointPossiblyUnderEllipsoid(_,q,F)}let se=F;se=Math.min(se,A(a.westIndices,a.westSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.southIndices,a.southSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.eastIndices,a.eastSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.northIndices,a.northSkirtHeight,z,U,p,k,V,X,Z));const ce=new e.AxisAlignedBoundingBox(X,Z,_),de=new n.TerrainEncoding(_,ce,se,H,G,j,m,E,T,f),he=de.stride,ue=new Float32Array(u*he+I*he);let le=0;for(let e=0;e<u;++e){if(j){const t=2*e;b.x=l[t],b.y=l[t+1]}le=de.encode(ue,le,q[e],U[e],z[e],b,Q[e],K[e])}const Ie=Math.max(0,2*(I-4)),ge=a.indices.length+3*Ie,me=o.IndexDatatype.createTypedArray(u+I,ge);me.set(a.indices,0);const Te=1e-4,fe=($-J)*Te,Ee=(te-ee)*Te,pe=-fe,ye=fe,Ne=Ee,we=-Ee;let Se=u*he;return C(ue,Se,re,de,z,U,l,k,p,a.westSkirtHeight,Y,O,pe,0),Se+=a.westIndices.length*he,C(ue,Se,oe,de,z,U,l,k,p,a.southSkirtHeight,Y,O,0,we),Se+=a.southIndices.length*he,C(ue,Se,ne,de,z,U,l,k,p,a.eastSkirtHeight,Y,O,ye,0),Se+=a.eastIndices.length*he,C(ue,Se,ie,de,z,U,l,k,p,a.northSkirtHeight,Y,O,0,Ne),g.addSkirtIndices(re,oe,ne,ie,u,me,a.indices.length),d.push(ue.buffer,me.buffer),{vertices:ue.buffer,indices:me.buffer,westIndicesSouthToNorth:re,southIndicesEastToWest:oe,eastIndicesNorthToSouth:ne,northIndicesWestToEast:ie,vertexStride:he,center:_,minimumHeight:F,maximumHeight:H,occludeePointInScaledSpace:ae,encoding:de,indexCountWithoutSkirts:a.indices.length}}))})); | ||
define(["./AxisAlignedBoundingBox-dd1e93db","./Matrix2-1ba2543c","./defaultValue-69ee94f4","./TerrainEncoding-365ddcc9","./IndexDatatype-0b020dfb","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./Transforms-fdc0a95d","./WebMercatorProjection-7e95daf8","./createTaskProcessorWorker","./AttributeCompression-4c4a8822","./WebGLConstants-f63312fc","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I){"use strict";function g(){a.DeveloperError.throwInstantiationError()}Object.defineProperties(g.prototype,{errorEvent:{get:a.DeveloperError.throwInstantiationError},credit:{get:a.DeveloperError.throwInstantiationError},tilingScheme:{get:a.DeveloperError.throwInstantiationError},ready:{get:a.DeveloperError.throwInstantiationError},readyPromise:{get:a.DeveloperError.throwInstantiationError},hasWaterMask:{get:a.DeveloperError.throwInstantiationError},hasVertexNormals:{get:a.DeveloperError.throwInstantiationError},availability:{get:a.DeveloperError.throwInstantiationError}});const m=[];g.getRegularGridIndices=function(e,t){let n=m[e];r.defined(n)||(m[e]=n=[]);let o=n[t];return r.defined(o)||(o=e*t<i.CesiumMath.SIXTY_FOUR_KILOBYTES?n[t]=new Uint16Array((e-1)*(t-1)*6):n[t]=new Uint32Array((e-1)*(t-1)*6),p(e,t,o,0)),o};const T=[];g.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=T[e];r.defined(n)||(T[e]=n=[]);let o=n[t];if(!r.defined(o)){const r=g.getRegularGridIndices(e,t),i=E(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const f=[];function E(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function p(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function y(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}g.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=f[e];r.defined(n)||(f[e]=n=[]);let i=n[t];if(!r.defined(i)){const r=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=r+s,d=a+6*Math.max(0,s-4),h=E(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,m=h.northIndicesWestToEast,T=o.IndexDatatype.createTypedArray(c,d);p(e,t,T,0),g.addSkirtIndices(u,l,I,m,r,T,a),i=n[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:m,indexCountWithoutSkirts:a}}return i},g.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=y(e,s,i,a),s+=e.length,a=y(t,s,i,a),s+=t.length,a=y(r,s,i,a),s+=r.length,y(n,s,i,a)},g.heightmapTerrainQuality=.25,g.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*g.heightmapTerrainQuality/(t*r)},g.prototype.requestTileGeometry=a.DeveloperError.throwInstantiationError,g.prototype.getLevelMaximumGeometricError=a.DeveloperError.throwInstantiationError,g.prototype.getTileDataAvailable=a.DeveloperError.throwInstantiationError,g.prototype.loadTileDataAvailability=a.DeveloperError.throwInstantiationError;const N=32767,w=new t.Cartesian3,S=new t.Cartesian3,M=new t.Cartesian3,b=new t.Cartographic,x=new t.Cartesian2;function A(e,r,n,o,a,s,c,d,h){let u=Number.POSITIVE_INFINITY;const l=a.north,I=a.south;let g=a.east;const m=a.west;g<m&&(g+=i.CesiumMath.TWO_PI);const T=e.length;for(let a=0;a<T;++a){const T=e[a],f=n[T],E=o[T];b.longitude=i.CesiumMath.lerp(m,g,E.x),b.latitude=i.CesiumMath.lerp(I,l,E.y),b.height=f-r;const p=s.cartographicToCartesian(b,w);t.Matrix4.multiplyByPoint(c,p,p),t.Cartesian3.minimumByComponent(p,d,d),t.Cartesian3.maximumByComponent(p,h,h),u=Math.min(u,b.height)}return u}function C(e,t,n,o,a,s,d,h,u,l,I,g,m,T){const f=r.defined(d),E=u.north,p=u.south;let y=u.east;const N=u.west;y<N&&(y+=i.CesiumMath.TWO_PI);const S=n.length;for(let r=0;r<S;++r){const u=n[r],S=a[u],M=s[u];b.longitude=i.CesiumMath.lerp(N,y,M.x)+m,b.latitude=i.CesiumMath.lerp(p,E,M.y)+T,b.height=S-l;const A=h.cartographicToCartesian(b,w);if(f){const e=2*u;x.x=d[e],x.y=d[e+1]}let C,W;o.hasWebMercatorT&&(C=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-I)*g),o.hasGeodeticSurfaceNormals&&(W=h.geodeticSurfaceNormal(A)),t=o.encode(e,t,A,M,b.height,x,C,W)}}function W(e,t){let n;return"function"==typeof e.slice&&(n=e.slice(),"function"!=typeof n.sort&&(n=void 0)),r.defined(n)||(n=Array.prototype.slice.call(e)),n.sort(t),n}return d((function(a,d){const h=a.quantizedVertices,u=h.length/3,l=a.octEncodedNormals,I=a.westIndices.length+a.eastIndices.length+a.southIndices.length+a.northIndices.length,m=a.includeWebMercatorT,T=a.exaggeration,f=a.exaggerationRelativeHeight,E=1!==T,p=t.Rectangle.clone(a.rectangle),y=p.west,v=p.south,P=p.east,D=p.north,k=t.Ellipsoid.clone(a.ellipsoid),F=a.minimumHeight,H=a.maximumHeight,_=a.relativeToCenter,G=s.Transforms.eastNorthUpToFixedFrame(_,k),V=t.Matrix4.inverseTransformation(G,new t.Matrix4);let Y,O;m&&(Y=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(v),O=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(D)-Y));const B=h.subarray(0,u),R=h.subarray(u,2*u),L=h.subarray(2*u,3*u),j=r.defined(l),U=new Array(u),z=new Array(u),q=new Array(u),Q=m?new Array(u):[],K=E?new Array(u):[],X=S;X.x=Number.POSITIVE_INFINITY,X.y=Number.POSITIVE_INFINITY,X.z=Number.POSITIVE_INFINITY;const Z=M;Z.x=Number.NEGATIVE_INFINITY,Z.y=Number.NEGATIVE_INFINITY,Z.z=Number.NEGATIVE_INFINITY;let J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,ee=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY;for(let e=0;e<u;++e){const r=B[e],n=R[e],o=r/N,a=n/N,s=i.CesiumMath.lerp(F,H,L[e]/N);b.longitude=i.CesiumMath.lerp(y,P,o),b.latitude=i.CesiumMath.lerp(v,D,a),b.height=s,J=Math.min(b.longitude,J),$=Math.max(b.longitude,$),ee=Math.min(b.latitude,ee),te=Math.max(b.latitude,te);const d=k.cartographicToCartesian(b);U[e]=new t.Cartesian2(o,a),z[e]=s,q[e]=d,m&&(Q[e]=(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b.latitude)-Y)*O),E&&(K[e]=k.geodeticSurfaceNormal(d)),t.Matrix4.multiplyByPoint(V,d,w),t.Cartesian3.minimumByComponent(w,X,X),t.Cartesian3.maximumByComponent(w,Z,Z)}const re=W(a.westIndices,(function(e,t){return U[e].y-U[t].y})),ne=W(a.eastIndices,(function(e,t){return U[t].y-U[e].y})),oe=W(a.southIndices,(function(e,t){return U[t].x-U[e].x})),ie=W(a.northIndices,(function(e,t){return U[e].x-U[t].x}));let ae;if(F<0){ae=new n.EllipsoidalOccluder(k).computeHorizonCullingPointPossiblyUnderEllipsoid(_,q,F)}let se=F;se=Math.min(se,A(a.westIndices,a.westSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.southIndices,a.southSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.eastIndices,a.eastSkirtHeight,z,U,p,k,V,X,Z)),se=Math.min(se,A(a.northIndices,a.northSkirtHeight,z,U,p,k,V,X,Z));const ce=new e.AxisAlignedBoundingBox(X,Z,_),de=new n.TerrainEncoding(_,ce,se,H,G,j,m,E,T,f),he=de.stride,ue=new Float32Array(u*he+I*he);let le=0;for(let e=0;e<u;++e){if(j){const t=2*e;x.x=l[t],x.y=l[t+1]}le=de.encode(ue,le,q[e],U[e],z[e],x,Q[e],K[e])}const Ie=Math.max(0,2*(I-4)),ge=a.indices.length+3*Ie,me=o.IndexDatatype.createTypedArray(u+I,ge);me.set(a.indices,0);const Te=1e-4,fe=($-J)*Te,Ee=(te-ee)*Te,pe=-fe,ye=fe,Ne=Ee,we=-Ee;let Se=u*he;return C(ue,Se,re,de,z,U,l,k,p,a.westSkirtHeight,Y,O,pe,0),Se+=a.westIndices.length*he,C(ue,Se,oe,de,z,U,l,k,p,a.southSkirtHeight,Y,O,0,we),Se+=a.southIndices.length*he,C(ue,Se,ne,de,z,U,l,k,p,a.eastSkirtHeight,Y,O,ye,0),Se+=a.eastIndices.length*he,C(ue,Se,ie,de,z,U,l,k,p,a.northSkirtHeight,Y,O,0,Ne),g.addSkirtIndices(re,oe,ne,ie,u,me,a.indices.length),d.push(ue.buffer,me.buffer),{vertices:ue.buffer,indices:me.buffer,westIndicesSouthToNorth:re,southIndicesEastToWest:oe,eastIndicesNorthToSouth:ne,northIndicesWestToEast:ie,vertexStride:he,center:_,minimumHeight:F,maximumHeight:H,occludeePointInScaledSpace:ae,encoding:de,indexCountWithoutSkirts:a.indices.length}}))})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./Transforms-06c05e21","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./VertexFormat-e68722dd","./WallGeometryLibrary-0ff0aa92","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./arrayRemoveDuplicates-fe254feb","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,n,i,a,o,r,s,l,m,u,c,p,d,f,y,g,h,C){"use strict";const x=new t.Cartesian3,b=new t.Cartesian3,A=new t.Cartesian3,_=new t.Cartesian3,E=new t.Cartesian3,w=new t.Cartesian3,F=new t.Cartesian3;function v(n){const a=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,o=n.maximumHeights,r=n.minimumHeights,s=e.defaultValue(n.vertexFormat,l.VertexFormat.DEFAULT),m=e.defaultValue(n.granularity,i.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=r,this._maximumHeights=o,this._vertexFormat=l.VertexFormat.clone(s),this._granularity=m,this._ellipsoid=t.Ellipsoid.clone(u),this._workerName="createWallGeometry";let c=1+a.length*t.Cartesian3.packedLength+2;e.defined(r)&&(c+=r.length),e.defined(o)&&(c+=o.length),this.packedLength=c+t.Ellipsoid.packedLength+l.VertexFormat.packedLength+1}v.pack=function(n,i,a){let o;a=e.defaultValue(a,0);const r=n._positions;let s=r.length;for(i[a++]=s,o=0;o<s;++o,a+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[o],i,a);const m=n._minimumHeights;if(s=e.defined(m)?m.length:0,i[a++]=s,e.defined(m))for(o=0;o<s;++o)i[a++]=m[o];const u=n._maximumHeights;if(s=e.defined(u)?u.length:0,i[a++]=s,e.defined(u))for(o=0;o<s;++o)i[a++]=u[o];return t.Ellipsoid.pack(n._ellipsoid,i,a),a+=t.Ellipsoid.packedLength,l.VertexFormat.pack(n._vertexFormat,i,a),i[a+=l.VertexFormat.packedLength]=n._granularity,i};const L=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),H=new l.VertexFormat,V={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:L,vertexFormat:H,granularity:void 0};return v.unpack=function(n,i,a){let o;i=e.defaultValue(i,0);let r=n[i++];const s=new Array(r);for(o=0;o<r;++o,i+=t.Cartesian3.packedLength)s[o]=t.Cartesian3.unpack(n,i);let m,u;if(r=n[i++],r>0)for(m=new Array(r),o=0;o<r;++o)m[o]=n[i++];if(r=n[i++],r>0)for(u=new Array(r),o=0;o<r;++o)u[o]=n[i++];const c=t.Ellipsoid.unpack(n,i,L);i+=t.Ellipsoid.packedLength;const p=l.VertexFormat.unpack(n,i,H),d=n[i+=l.VertexFormat.packedLength];return e.defined(a)?(a._positions=s,a._minimumHeights=m,a._maximumHeights=u,a._ellipsoid=t.Ellipsoid.clone(c,a._ellipsoid),a._vertexFormat=l.VertexFormat.clone(p,a._vertexFormat),a._granularity=d,a):(V.positions=s,V.minimumHeights=m,V.maximumHeights=u,V.granularity=d,new v(V))},v.fromConstantHeights=function(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions;let i,a;const o=t.minimumHeight,r=t.maximumHeight,s=e.defined(o),l=e.defined(r);if(s||l){const e=n.length;i=s?new Array(e):void 0,a=l?new Array(e):void 0;for(let t=0;t<e;++t)s&&(i[t]=o),l&&(a[t]=r)}return new v({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},v.createGeometry=function(a){const l=a._positions,u=a._minimumHeights,c=a._maximumHeights,p=a._vertexFormat,d=a._granularity,f=a._ellipsoid,y=m.WallGeometryLibrary.computePositions(f,l,c,u,d,!0);if(!e.defined(y))return;const g=y.bottomPositions,h=y.topPositions,C=y.numCorners;let v=h.length,L=2*v;const H=p.position?new Float64Array(L):void 0,V=p.normal?new Float32Array(L):void 0,k=p.tangent?new Float32Array(L):void 0,G=p.bitangent?new Float32Array(L):void 0,D=p.st?new Float32Array(L/3*2):void 0;let P,T=0,z=0,O=0,R=0,S=0,I=F,N=w,M=E,W=!0;v/=3;let B=0;const U=1/(v-C-1);for(P=0;P<v;++P){const e=3*P,n=t.Cartesian3.fromArray(h,e,x),a=t.Cartesian3.fromArray(g,e,b);if(p.position&&(H[T++]=a.x,H[T++]=a.y,H[T++]=a.z,H[T++]=n.x,H[T++]=n.y,H[T++]=n.z),p.st&&(D[S++]=B,D[S++]=0,D[S++]=B,D[S++]=1),p.normal||p.tangent||p.bitangent){let a=t.Cartesian3.clone(t.Cartesian3.ZERO,_);const o=t.Cartesian3.subtract(n,f.geodeticSurfaceNormal(n,b),b);if(P+1<v&&(a=t.Cartesian3.fromArray(h,e+3,_)),W){const e=t.Cartesian3.subtract(a,n,A),i=t.Cartesian3.subtract(o,n,x);I=t.Cartesian3.normalize(t.Cartesian3.cross(i,e,I),I),W=!1}t.Cartesian3.equalsEpsilon(n,a,i.CesiumMath.EPSILON10)?W=!0:(B+=U,p.tangent&&(N=t.Cartesian3.normalize(t.Cartesian3.subtract(a,n,N),N)),p.bitangent&&(M=t.Cartesian3.normalize(t.Cartesian3.cross(I,N,M),M))),p.normal&&(V[z++]=I.x,V[z++]=I.y,V[z++]=I.z,V[z++]=I.x,V[z++]=I.y,V[z++]=I.z),p.tangent&&(k[R++]=N.x,k[R++]=N.y,k[R++]=N.z,k[R++]=N.x,k[R++]=N.y,k[R++]=N.z),p.bitangent&&(G[O++]=M.x,G[O++]=M.y,G[O++]=M.z,G[O++]=M.x,G[O++]=M.y,G[O++]=M.z)}}const q=new r.GeometryAttributes;p.position&&(q.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:H})),p.normal&&(q.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),p.tangent&&(q.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:k})),p.bitangent&&(q.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),p.st&&(q.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D}));const J=L/3;L-=6*(C+1);const Y=s.IndexDatatype.createTypedArray(J,L);let j=0;for(P=0;P<J-2;P+=2){const e=P,n=P+2,a=t.Cartesian3.fromArray(H,3*e,x),o=t.Cartesian3.fromArray(H,3*n,b);if(t.Cartesian3.equalsEpsilon(a,o,i.CesiumMath.EPSILON10))continue;const r=P+1,s=P+3;Y[j++]=r,Y[j++]=e,Y[j++]=s,Y[j++]=s,Y[j++]=e,Y[j++]=n}return new o.Geometry({attributes:q,indices:Y,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new n.BoundingSphere.fromVertices(H)})},function(n,i){return e.defined(i)&&(n=v.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),v.createGeometry(n)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./Transforms-fdc0a95d","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./VertexFormat-e68722dd","./WallGeometryLibrary-55f64681","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./arrayRemoveDuplicates-7d5d09a3","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,n,i,a,o,r,s,l,m,u,p,d,c,f,y,g,h,C){"use strict";const b=new t.Cartesian3,x=new t.Cartesian3,A=new t.Cartesian3,_=new t.Cartesian3,E=new t.Cartesian3,w=new t.Cartesian3,F=new t.Cartesian3;function v(n){const a=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,o=n.maximumHeights,r=n.minimumHeights,s=e.defaultValue(n.vertexFormat,l.VertexFormat.DEFAULT),m=e.defaultValue(n.granularity,i.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=r,this._maximumHeights=o,this._vertexFormat=l.VertexFormat.clone(s),this._granularity=m,this._ellipsoid=t.Ellipsoid.clone(u),this._workerName="createWallGeometry";let p=1+a.length*t.Cartesian3.packedLength+2;e.defined(r)&&(p+=r.length),e.defined(o)&&(p+=o.length),this.packedLength=p+t.Ellipsoid.packedLength+l.VertexFormat.packedLength+1}v.pack=function(n,i,a){let o;a=e.defaultValue(a,0);const r=n._positions;let s=r.length;for(i[a++]=s,o=0;o<s;++o,a+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[o],i,a);const m=n._minimumHeights;if(s=e.defined(m)?m.length:0,i[a++]=s,e.defined(m))for(o=0;o<s;++o)i[a++]=m[o];const u=n._maximumHeights;if(s=e.defined(u)?u.length:0,i[a++]=s,e.defined(u))for(o=0;o<s;++o)i[a++]=u[o];return t.Ellipsoid.pack(n._ellipsoid,i,a),a+=t.Ellipsoid.packedLength,l.VertexFormat.pack(n._vertexFormat,i,a),i[a+=l.VertexFormat.packedLength]=n._granularity,i};const L=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),H=new l.VertexFormat,V={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:L,vertexFormat:H,granularity:void 0};return v.unpack=function(n,i,a){let o;i=e.defaultValue(i,0);let r=n[i++];const s=new Array(r);for(o=0;o<r;++o,i+=t.Cartesian3.packedLength)s[o]=t.Cartesian3.unpack(n,i);let m,u;if(r=n[i++],r>0)for(m=new Array(r),o=0;o<r;++o)m[o]=n[i++];if(r=n[i++],r>0)for(u=new Array(r),o=0;o<r;++o)u[o]=n[i++];const p=t.Ellipsoid.unpack(n,i,L);i+=t.Ellipsoid.packedLength;const d=l.VertexFormat.unpack(n,i,H),c=n[i+=l.VertexFormat.packedLength];return e.defined(a)?(a._positions=s,a._minimumHeights=m,a._maximumHeights=u,a._ellipsoid=t.Ellipsoid.clone(p,a._ellipsoid),a._vertexFormat=l.VertexFormat.clone(d,a._vertexFormat),a._granularity=c,a):(V.positions=s,V.minimumHeights=m,V.maximumHeights=u,V.granularity=c,new v(V))},v.fromConstantHeights=function(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions;let i,a;const o=t.minimumHeight,r=t.maximumHeight,s=e.defined(o),l=e.defined(r);if(s||l){const e=n.length;i=s?new Array(e):void 0,a=l?new Array(e):void 0;for(let t=0;t<e;++t)s&&(i[t]=o),l&&(a[t]=r)}return new v({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},v.createGeometry=function(a){const l=a._positions,u=a._minimumHeights,p=a._maximumHeights,d=a._vertexFormat,c=a._granularity,f=a._ellipsoid,y=m.WallGeometryLibrary.computePositions(f,l,p,u,c,!0);if(!e.defined(y))return;const g=y.bottomPositions,h=y.topPositions,C=y.numCorners;let v=h.length,L=2*v;const H=d.position?new Float64Array(L):void 0,V=d.normal?new Float32Array(L):void 0,k=d.tangent?new Float32Array(L):void 0,G=d.bitangent?new Float32Array(L):void 0,D=d.st?new Float32Array(L/3*2):void 0;let P,T=0,z=0,O=0,R=0,S=0,I=F,N=w,M=E,W=!0;v/=3;let B=0;const U=1/(v-C-1);for(P=0;P<v;++P){const e=3*P,n=t.Cartesian3.fromArray(h,e,b),a=t.Cartesian3.fromArray(g,e,x);if(d.position&&(H[T++]=a.x,H[T++]=a.y,H[T++]=a.z,H[T++]=n.x,H[T++]=n.y,H[T++]=n.z),d.st&&(D[S++]=B,D[S++]=0,D[S++]=B,D[S++]=1),d.normal||d.tangent||d.bitangent){let a=t.Cartesian3.clone(t.Cartesian3.ZERO,_);const o=t.Cartesian3.subtract(n,f.geodeticSurfaceNormal(n,x),x);if(P+1<v&&(a=t.Cartesian3.fromArray(h,e+3,_)),W){const e=t.Cartesian3.subtract(a,n,A),i=t.Cartesian3.subtract(o,n,b);I=t.Cartesian3.normalize(t.Cartesian3.cross(i,e,I),I),W=!1}t.Cartesian3.equalsEpsilon(n,a,i.CesiumMath.EPSILON10)?W=!0:(B+=U,d.tangent&&(N=t.Cartesian3.normalize(t.Cartesian3.subtract(a,n,N),N)),d.bitangent&&(M=t.Cartesian3.normalize(t.Cartesian3.cross(I,N,M),M))),d.normal&&(V[z++]=I.x,V[z++]=I.y,V[z++]=I.z,V[z++]=I.x,V[z++]=I.y,V[z++]=I.z),d.tangent&&(k[R++]=N.x,k[R++]=N.y,k[R++]=N.z,k[R++]=N.x,k[R++]=N.y,k[R++]=N.z),d.bitangent&&(G[O++]=M.x,G[O++]=M.y,G[O++]=M.z,G[O++]=M.x,G[O++]=M.y,G[O++]=M.z)}}const q=new r.GeometryAttributes;d.position&&(q.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:H})),d.normal&&(q.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),d.tangent&&(q.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:k})),d.bitangent&&(q.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d.st&&(q.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D}));const J=L/3;L-=6*(C+1);const Y=s.IndexDatatype.createTypedArray(J,L);let j=0;for(P=0;P<J-2;P+=2){const e=P,n=P+2,a=t.Cartesian3.fromArray(H,3*e,b),o=t.Cartesian3.fromArray(H,3*n,x);if(t.Cartesian3.equalsEpsilon(a,o,i.CesiumMath.EPSILON10))continue;const r=P+1,s=P+3;Y[j++]=r,Y[j++]=e,Y[j++]=s,Y[j++]=s,Y[j++]=e,Y[j++]=n}return new o.Geometry({attributes:q,indices:Y,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new n.BoundingSphere.fromVertices(H)})},function(n,i){return e.defined(i)&&(n=v.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),v.createGeometry(n)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultValue-69ee94f4","./Matrix2-e6265fb0","./Transforms-06c05e21","./ComponentDatatype-a9820060","./RuntimeError-ac440aa5","./GeometryAttribute-b7edcc35","./GeometryAttributes-1b4134a9","./IndexDatatype-1cbc8622","./WallGeometryLibrary-0ff0aa92","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./arrayRemoveDuplicates-fe254feb","./PolylinePipeline-256ec228","./EllipsoidGeodesic-f4459924","./EllipsoidRhumbLine-94e77fa4","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,i,t,n,o,a,s,r,l,m,u,d,c,p,f,h,g,y){"use strict";const _=new i.Cartesian3,E=new i.Cartesian3;function H(t){const o=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,a=t.maximumHeights,s=t.minimumHeights,r=e.defaultValue(t.granularity,n.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=o,this._minimumHeights=s,this._maximumHeights=a,this._granularity=r,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+o.length*i.Cartesian3.packedLength+2;e.defined(s)&&(m+=s.length),e.defined(a)&&(m+=a.length),this.packedLength=m+i.Ellipsoid.packedLength+1}H.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[o++]=r,e.defined(m))for(a=0;a<r;++a)n[o++]=m[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const C=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:C,granularity:void 0};return H.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),a=0;a<s;++a)m[a]=t[n++];const u=i.Ellipsoid.unpack(t,n,C),d=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(u,o._ellipsoid),o._granularity=d,o):(b.positions=r,b.minimumHeights=l,b.maximumHeights=m,b.granularity=d,new H(b))},H.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new H({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},H.createGeometry=function(o){const m=o._positions,u=o._minimumHeights,d=o._maximumHeights,c=o._granularity,p=o._ellipsoid,f=l.WallGeometryLibrary.computePositions(p,m,d,u,c,!1);if(!e.defined(f))return;const h=f.bottomPositions,g=f.topPositions;let y=g.length,H=2*y;const C=new Float64Array(H);let b,A=0;for(y/=3,b=0;b<y;++b){const e=3*b,t=i.Cartesian3.fromArray(g,e,_),n=i.Cartesian3.fromArray(h,e,E);C[A++]=n.x,C[A++]=n.y,C[A++]=n.z,C[A++]=t.x,C[A++]=t.y,C[A++]=t.z}const k=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:C})}),w=H/3;H=2*w-4+w;const x=r.IndexDatatype.createTypedArray(w,H);let G=0;for(b=0;b<w-2;b+=2){const e=b,t=b+2,o=i.Cartesian3.fromArray(C,3*e,_),a=i.Cartesian3.fromArray(C,3*t,E);if(i.Cartesian3.equalsEpsilon(o,a,n.CesiumMath.EPSILON10))continue;const s=b+1,r=b+3;x[G++]=s,x[G++]=e,x[G++]=s,x[G++]=r,x[G++]=e,x[G++]=t}return x[G++]=w-2,x[G++]=w-1,new a.Geometry({attributes:k,indices:x,primitiveType:a.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(C)})},function(t,n){return e.defined(n)&&(t=H.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),H.createGeometry(t)}})); | ||
define(["./defaultValue-69ee94f4","./Matrix2-1ba2543c","./Transforms-fdc0a95d","./ComponentDatatype-07fbb0d4","./RuntimeError-ac440aa5","./GeometryAttribute-d50ea0de","./GeometryAttributes-1b4134a9","./IndexDatatype-0b020dfb","./WallGeometryLibrary-55f64681","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./arrayRemoveDuplicates-7d5d09a3","./PolylinePipeline-4f5c4291","./EllipsoidGeodesic-1ab9765d","./EllipsoidRhumbLine-001b8738","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,i,t,n,o,a,s,r,l,m,d,u,p,c,f,h,g,y){"use strict";const _=new i.Cartesian3,E=new i.Cartesian3;function b(t){const o=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,a=t.maximumHeights,s=t.minimumHeights,r=e.defaultValue(t.granularity,n.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=o,this._minimumHeights=s,this._maximumHeights=a,this._granularity=r,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+o.length*i.Cartesian3.packedLength+2;e.defined(s)&&(m+=s.length),e.defined(a)&&(m+=a.length),this.packedLength=m+i.Ellipsoid.packedLength+1}b.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[o++]=r,e.defined(m))for(a=0;a<r;++a)n[o++]=m[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const H=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),C={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:H,granularity:void 0};return b.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),a=0;a<s;++a)m[a]=t[n++];const d=i.Ellipsoid.unpack(t,n,H),u=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(d,o._ellipsoid),o._granularity=u,o):(C.positions=r,C.minimumHeights=l,C.maximumHeights=m,C.granularity=u,new b(C))},b.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new b({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},b.createGeometry=function(o){const m=o._positions,d=o._minimumHeights,u=o._maximumHeights,p=o._granularity,c=o._ellipsoid,f=l.WallGeometryLibrary.computePositions(c,m,u,d,p,!1);if(!e.defined(f))return;const h=f.bottomPositions,g=f.topPositions;let y=g.length,b=2*y;const H=new Float64Array(b);let C,A=0;for(y/=3,C=0;C<y;++C){const e=3*C,t=i.Cartesian3.fromArray(g,e,_),n=i.Cartesian3.fromArray(h,e,E);H[A++]=n.x,H[A++]=n.y,H[A++]=n.z,H[A++]=t.x,H[A++]=t.y,H[A++]=t.z}const k=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:H})}),w=b/3;b=2*w-4+w;const x=r.IndexDatatype.createTypedArray(w,b);let G=0;for(C=0;C<w-2;C+=2){const e=C,t=C+2,o=i.Cartesian3.fromArray(H,3*e,_),a=i.Cartesian3.fromArray(H,3*t,E);if(i.Cartesian3.equalsEpsilon(o,a,n.CesiumMath.EPSILON10))continue;const s=C+1,r=C+3;x[G++]=s,x[G++]=e,x[G++]=s,x[G++]=r,x[G++]=e,x[G++]=t}return x[G++]=w-2,x[G++]=w-1,new a.Geometry({attributes:k,indices:x,primitiveType:a.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(H)})},function(t,n){return e.defined(n)&&(t=b.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),b.createGeometry(t)}})); |
@@ -1,1 +0,1 @@ | ||
define(["./ComponentDatatype-a9820060","./defaultValue-69ee94f4","./IndexDatatype-1cbc8622","./RuntimeError-ac440aa5","./createTaskProcessorWorker","./WebGLConstants-f63312fc"],(function(t,e,r,n,o,a){"use strict";let i;function s(t,e){const n=t.num_points(),o=t.num_faces(),a=new i.DracoInt32Array,s=3*o,c=r.IndexDatatype.createTypedArray(n,s);let u=0;for(let r=0;r<o;++r)e.GetFaceFromMesh(t,r,a),c[u+0]=a.GetValue(0),c[u+1]=a.GetValue(1),c[u+2]=a.GetValue(2),u+=3;return i.destroy(a),{typedArray:c,numberOfIndices:s}}function c(r,n,o){const a=r.num_points(),s=o.num_components();let c,u=new i.AttributeQuantizationTransform;if(u.InitFromAttribute(o)){const t=new Array(s);for(let e=0;e<s;++e)t[e]=u.min_value(e);c={quantizationBits:u.quantization_bits(),minValues:t,range:u.range(),octEncoded:!1}}i.destroy(u),u=new i.AttributeOctahedronTransform,u.InitFromAttribute(o)&&(c={quantizationBits:u.quantization_bits(),octEncoded:!0}),i.destroy(u);const d=a*s;let f;f=e.defined(c)?function(t,e,r,n,o){let a,s;n.quantizationBits<=8?(s=new i.DracoUInt8Array,a=new Uint8Array(o),e.GetAttributeUInt8ForAllPoints(t,r,s)):(s=new i.DracoUInt16Array,a=new Uint16Array(o),e.GetAttributeUInt16ForAllPoints(t,r,s));for(let t=0;t<o;++t)a[t]=s.GetValue(t);return i.destroy(s),a}(r,n,o,c,d):function(t,e,r,n){let o,a;switch(r.data_type()){case 1:case 11:a=new i.DracoInt8Array,o=new Int8Array(n),e.GetAttributeInt8ForAllPoints(t,r,a);break;case 2:a=new i.DracoUInt8Array,o=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,r,a);break;case 3:a=new i.DracoInt16Array,o=new Int16Array(n),e.GetAttributeInt16ForAllPoints(t,r,a);break;case 4:a=new i.DracoUInt16Array,o=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,r,a);break;case 5:case 7:a=new i.DracoInt32Array,o=new Int32Array(n),e.GetAttributeInt32ForAllPoints(t,r,a);break;case 6:case 8:a=new i.DracoUInt32Array,o=new Uint32Array(n),e.GetAttributeUInt32ForAllPoints(t,r,a);break;case 9:case 10:a=new i.DracoFloat32Array,o=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,r,a)}for(let t=0;t<n;++t)o[t]=a.GetValue(t);return i.destroy(a),o}(r,n,o,d);const y=t.ComponentDatatype.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:s,componentDatatype:y,byteOffset:o.byte_offset(),byteStride:t.ComponentDatatype.getSizeInBytes(y)*s,normalized:o.normalized(),quantization:c}}}function u(t){return e.defined(t.bufferView)?function(t){const e=new i.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let t=0;t<r.length;++t)e.SkipAttributeTransform(i[r[t]]);const o=t.bufferView,a=new i.DecoderBuffer;if(a.Init(t.array,o.byteLength),e.GetEncodedGeometryType(a)!==i.TRIANGULAR_MESH)throw new n.RuntimeError("Unsupported draco mesh geometry type.");const u=new i.Mesh,d=e.DecodeBufferToMesh(a,u);if(!d.ok()||0===u.ptr)throw new n.RuntimeError(`Error decoding draco mesh geometry: ${d.error_msg()}`);i.destroy(a);const f={},y=t.compressedAttributes;for(const t in y)if(y.hasOwnProperty(t)){const r=y[t],n=e.GetAttributeByUniqueId(u,r);f[t]=c(u,e,n)}const A={indexArray:s(u,e),attributeData:f};return i.destroy(u),i.destroy(e),A}(t):function(t){const e=new i.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(i.POSITION),e.SkipAttributeTransform(i.NORMAL));const r=new i.DecoderBuffer;if(r.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(r)!==i.POINT_CLOUD)throw new n.RuntimeError("Draco geometry type must be POINT_CLOUD.");const o=new i.PointCloud,a=e.DecodeBufferToPointCloud(r,o);if(!a.ok()||0===o.ptr)throw new n.RuntimeError(`Error decoding draco point cloud: ${a.error_msg()}`);i.destroy(r);const s={},u=t.properties;for(const t in u)if(u.hasOwnProperty(t)){let r;if("POSITION"===t||"NORMAL"===t){const n=e.GetAttributeId(o,i[t]);r=e.GetAttribute(o,n)}else{const n=u[t];r=e.GetAttributeByUniqueId(o,n)}s[t]=c(o,e,r)}return i.destroy(o),i.destroy(e),s}(t)}function d(t){i=t,self.onmessage=o(u),self.postMessage(!0)}return function(t){const r=t.data.webAssemblyConfig;if(e.defined(r))return require([r.modulePath],(function(t){e.defined(r.wasmBinaryFile)?(e.defined(t)||(t=self.DracoDecoderModule),t(r).then((function(t){d(t)}))):d(t())}))}})); | ||
define(["./ComponentDatatype-07fbb0d4","./defaultValue-69ee94f4","./IndexDatatype-0b020dfb","./RuntimeError-ac440aa5","./createTaskProcessorWorker","./WebGLConstants-f63312fc"],(function(t,e,r,n,o,a){"use strict";let i;function s(t,e){const n=t.num_points(),o=t.num_faces(),a=new i.DracoInt32Array,s=3*o,u=r.IndexDatatype.createTypedArray(n,s);let c=0;for(let r=0;r<o;++r)e.GetFaceFromMesh(t,r,a),u[c+0]=a.GetValue(0),u[c+1]=a.GetValue(1),u[c+2]=a.GetValue(2),c+=3;return i.destroy(a),{typedArray:u,numberOfIndices:s}}function u(r,n,o){const a=r.num_points(),s=o.num_components();let u,c=new i.AttributeQuantizationTransform;if(c.InitFromAttribute(o)){const t=new Array(s);for(let e=0;e<s;++e)t[e]=c.min_value(e);u={quantizationBits:c.quantization_bits(),minValues:t,range:c.range(),octEncoded:!1}}i.destroy(c),c=new i.AttributeOctahedronTransform,c.InitFromAttribute(o)&&(u={quantizationBits:c.quantization_bits(),octEncoded:!0}),i.destroy(c);const d=a*s;let f;f=e.defined(u)?function(t,e,r,n,o){let a,s;n.quantizationBits<=8?(s=new i.DracoUInt8Array,a=new Uint8Array(o),e.GetAttributeUInt8ForAllPoints(t,r,s)):(s=new i.DracoUInt16Array,a=new Uint16Array(o),e.GetAttributeUInt16ForAllPoints(t,r,s));for(let t=0;t<o;++t)a[t]=s.GetValue(t);return i.destroy(s),a}(r,n,o,u,d):function(t,e,r,n){let o,a;switch(r.data_type()){case 1:case 11:a=new i.DracoInt8Array,o=new Int8Array(n),e.GetAttributeInt8ForAllPoints(t,r,a);break;case 2:a=new i.DracoUInt8Array,o=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,r,a);break;case 3:a=new i.DracoInt16Array,o=new Int16Array(n),e.GetAttributeInt16ForAllPoints(t,r,a);break;case 4:a=new i.DracoUInt16Array,o=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,r,a);break;case 5:case 7:a=new i.DracoInt32Array,o=new Int32Array(n),e.GetAttributeInt32ForAllPoints(t,r,a);break;case 6:case 8:a=new i.DracoUInt32Array,o=new Uint32Array(n),e.GetAttributeUInt32ForAllPoints(t,r,a);break;case 9:case 10:a=new i.DracoFloat32Array,o=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,r,a)}for(let t=0;t<n;++t)o[t]=a.GetValue(t);return i.destroy(a),o}(r,n,o,d);const y=t.ComponentDatatype.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:s,componentDatatype:y,byteOffset:o.byte_offset(),byteStride:t.ComponentDatatype.getSizeInBytes(y)*s,normalized:o.normalized(),quantization:u}}}function c(t){return e.defined(t.bufferView)?function(t){const e=new i.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let t=0;t<r.length;++t)e.SkipAttributeTransform(i[r[t]]);const o=t.bufferView,a=new i.DecoderBuffer;if(a.Init(t.array,o.byteLength),e.GetEncodedGeometryType(a)!==i.TRIANGULAR_MESH)throw new n.RuntimeError("Unsupported draco mesh geometry type.");const c=new i.Mesh,d=e.DecodeBufferToMesh(a,c);if(!d.ok()||0===c.ptr)throw new n.RuntimeError(`Error decoding draco mesh geometry: ${d.error_msg()}`);i.destroy(a);const f={},y=t.compressedAttributes;for(const t in y)if(y.hasOwnProperty(t)){const r=y[t],n=e.GetAttributeByUniqueId(c,r);f[t]=u(c,e,n)}const A={indexArray:s(c,e),attributeData:f};return i.destroy(c),i.destroy(e),A}(t):function(t){const e=new i.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(i.POSITION),e.SkipAttributeTransform(i.NORMAL));const r=new i.DecoderBuffer;if(r.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(r)!==i.POINT_CLOUD)throw new n.RuntimeError("Draco geometry type must be POINT_CLOUD.");const o=new i.PointCloud,a=e.DecodeBufferToPointCloud(r,o);if(!a.ok()||0===o.ptr)throw new n.RuntimeError(`Error decoding draco point cloud: ${a.error_msg()}`);i.destroy(r);const s={},c=t.properties;for(const t in c)if(c.hasOwnProperty(t)){let r;if("POSITION"===t||"NORMAL"===t){const n=e.GetAttributeId(o,i[t]);r=e.GetAttribute(o,n)}else{const n=c[t];r=e.GetAttributeByUniqueId(o,n)}s[t]=u(o,e,r)}return i.destroy(o),i.destroy(e),s}(t)}function d(t){i=t,self.onmessage=o(c),self.postMessage(!0)}return function(t){const r=t.data.webAssemblyConfig;if(e.defined(r))return require([r.modulePath],(function(t){e.defined(r.wasmBinaryFile)?(e.defined(t)||(t=self.DracoDecoderModule),t(r).then((function(t){d(t)}))):d(t())}))}})); |
@@ -1,1 +0,1 @@ | ||
define(["./AttributeCompression-6e71d14f","./Transforms-06c05e21","./Matrix2-e6265fb0","./defaultValue-69ee94f4","./TerrainEncoding-7f4829f1","./IndexDatatype-1cbc8622","./RuntimeError-ac440aa5","./ComponentDatatype-a9820060","./OrientedBoundingBox-0f36ec8f","./createTaskProcessorWorker","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-01395a15","./AxisAlignedBoundingBox-5ba8fa79","./IntersectionTests-94cb8698","./Plane-042297c7"],(function(e,t,n,i,s,r,h,o,u,p,d,l,a,f,c,g,m){"use strict";const x={clipTriangleAtAxisAlignedThreshold:function(e,t,n,s,r,h){let o,u,p;i.defined(h)?h.length=0:h=[],t?(o=n<e,u=s<e,p=r<e):(o=n>e,u=s>e,p=r>e);const d=o+u+p;let l,a,f,c,g,m;return 1===d?o?(l=(e-n)/(s-n),a=(e-n)/(r-n),h.push(1),h.push(2),1!==a&&(h.push(-1),h.push(0),h.push(2),h.push(a)),1!==l&&(h.push(-1),h.push(0),h.push(1),h.push(l))):u?(f=(e-s)/(r-s),c=(e-s)/(n-s),h.push(2),h.push(0),1!==c&&(h.push(-1),h.push(1),h.push(0),h.push(c)),1!==f&&(h.push(-1),h.push(1),h.push(2),h.push(f))):p&&(g=(e-r)/(n-r),m=(e-r)/(s-r),h.push(0),h.push(1),1!==m&&(h.push(-1),h.push(2),h.push(1),h.push(m)),1!==g&&(h.push(-1),h.push(2),h.push(0),h.push(g))):2===d?o||n===e?u||s===e?p||r===e||(a=(e-n)/(r-n),f=(e-s)/(r-s),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(a),h.push(-1),h.push(1),h.push(2),h.push(f)):(m=(e-r)/(s-r),l=(e-n)/(s-n),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(m),h.push(-1),h.push(0),h.push(1),h.push(l)):(c=(e-s)/(n-s),g=(e-r)/(n-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(c),h.push(-1),h.push(2),h.push(0),h.push(g)):3!==d&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,s,r,h,o,u,p,d){const l=s-u,a=u-h,f=o-p,c=r-p,g=1/(f*l+a*c),m=t-p,x=e-u,w=(f*x+a*m)*g,C=(-c*x+l*m)*g,B=1-w-C;return i.defined(d)?(d.x=w,d.y=C,d.z=B,d):new n.Cartesian3(w,C,B)},computeLineSegmentLineSegmentIntersection:function(e,t,s,r,h,o,u,p,d){const l=(p-o)*(s-e)-(u-h)*(r-t);if(0===l)return;const a=((u-h)*(t-o)-(p-o)*(e-h))/l,f=((s-e)*(t-o)-(r-t)*(e-h))/l;return a>=0&&a<=1&&f>=0&&f<=1?(i.defined(d)||(d=new n.Cartesian2),d.x=e+a*(s-e),d.y=t+a*(r-t),d):void 0}},w=32767,C=16383,B=[],y=[],I=[],A=new n.Cartographic;let b=new n.Cartesian3;const v=[],T=[],z=[],V=[],M=[],N=new n.Cartesian3,E=new t.BoundingSphere,H=new u.OrientedBoundingBox,R=new n.Cartesian2,O=new n.Cartesian3;function S(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}S.prototype.clone=function(e){return i.defined(e)||(e=new S),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},S.prototype.initializeIndexed=function(e,t,n,i,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},S.prototype.initializeFromClipResult=function(e,t,n){let i=t+1;return-1!==e[t]?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[i]],++i,this.second=n[e[i]],++i,this.ratio=e[i],++i),i},S.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},S.prototype.isIndexed=function(){return i.defined(this.index)},S.prototype.getH=function(){return i.defined(this.index)?this.heightBuffer[this.index]:o.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},S.prototype.getU=function(){return i.defined(this.index)?this.uBuffer[this.index]:o.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},S.prototype.getV=function(){return i.defined(this.index)?this.vBuffer[this.index]:o.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};let U=new n.Cartesian2,F=-1;const P=[new n.Cartesian3,new n.Cartesian3],D=[new n.Cartesian3,new n.Cartesian3];function W(t,i){++F;let s=P[F],r=D[F];return s=e.AttributeCompression.octDecode(t.first.getNormalX(),t.first.getNormalY(),s),r=e.AttributeCompression.octDecode(t.second.getNormalX(),t.second.getNormalY(),r),b=n.Cartesian3.lerp(s,r,t.ratio,b),n.Cartesian3.normalize(b,b),e.AttributeCompression.octEncode(b,i),--F,i}S.prototype.getNormalX=function(){return i.defined(this.index)?this.normalBuffer[2*this.index]:(U=W(this,U),U.x)},S.prototype.getNormalY=function(){return i.defined(this.index)?this.normalBuffer[2*this.index+1]:(U=W(this,U),U.y)};const X=[];function k(e,t,n,s,r,h,o,u,p){if(0===o.length)return;let d=0,l=0;for(;l<o.length;)l=X[d++].initializeFromClipResult(o,l,u);for(let r=0;r<d;++r){const o=X[r];if(o.isIndexed())o.newIndex=h[o.index],o.uBuffer=e,o.vBuffer=t,o.heightBuffer=n,p&&(o.normalBuffer=s);else{const r=o.getKey();if(i.defined(h[r]))o.newIndex=h[r];else{const i=e.length;e.push(o.getU()),t.push(o.getV()),n.push(o.getH()),p&&(s.push(o.getNormalX()),s.push(o.getNormalY())),o.newIndex=i,h[r]=i}}}3===d?(r.push(X[0].newIndex),r.push(X[1].newIndex),r.push(X[2].newIndex)):4===d&&(r.push(X[0].newIndex),r.push(X[1].newIndex),r.push(X[2].newIndex),r.push(X[0].newIndex),r.push(X[2].newIndex),r.push(X[3].newIndex))}return X.push(new S),X.push(new S),X.push(new S),X.push(new S),p((function(e,i){const h=e.isEastChild,p=e.isNorthChild,d=h?C:0,l=h?w:C,a=p?C:0,f=p?w:C,c=v,g=T,m=z,U=M;c.length=0,g.length=0,m.length=0,U.length=0;const F=V;F.length=0;const P={},D=e.vertices;let W=e.indices;W=W.subarray(0,e.indexCountWithoutSkirts);const X=s.TerrainEncoding.clone(e.encoding),K=X.hasVertexNormals;let L=0;const Y=e.vertexCountWithoutSkirts,_=e.minimumHeight,j=e.maximumHeight,G=new Array(Y),J=new Array(Y),Z=new Array(Y),q=K?new Array(2*Y):void 0;let Q,$,ee,te,ne;for($=0,ee=0;$<Y;++$,ee+=2){const e=X.decodeTextureCoordinates(D,$,R);if(Q=X.decodeHeight(D,$),te=o.CesiumMath.clamp(e.x*w|0,0,w),ne=o.CesiumMath.clamp(e.y*w|0,0,w),Z[$]=o.CesiumMath.clamp((Q-_)/(j-_)*w|0,0,w),te<20&&(te=0),ne<20&&(ne=0),w-te<20&&(te=w),w-ne<20&&(ne=w),G[$]=te,J[$]=ne,K){const e=X.getOctEncodedNormal(D,$,O);q[ee]=e.x,q[ee+1]=e.y}(h&&te>=C||!h&&te<=C)&&(p&&ne>=C||!p&&ne<=C)&&(P[$]=L,c.push(te),g.push(ne),m.push(Z[$]),K&&(U.push(q[ee]),U.push(q[ee+1])),++L)}const ie=[];ie.push(new S),ie.push(new S),ie.push(new S);const se=[];let re,he;for(se.push(new S),se.push(new S),se.push(new S),$=0;$<W.length;$+=3){const e=W[$],t=W[$+1],n=W[$+2],i=G[e],s=G[t],r=G[n];ie[0].initializeIndexed(G,J,Z,q,e),ie[1].initializeIndexed(G,J,Z,q,t),ie[2].initializeIndexed(G,J,Z,q,n);const o=x.clipTriangleAtAxisAlignedThreshold(C,h,i,s,r,B);re=0,re>=o.length||(re=se[0].initializeFromClipResult(o,re,ie),re>=o.length||(re=se[1].initializeFromClipResult(o,re,ie),re>=o.length||(re=se[2].initializeFromClipResult(o,re,ie),he=x.clipTriangleAtAxisAlignedThreshold(C,p,se[0].getV(),se[1].getV(),se[2].getV(),y),k(c,g,m,U,F,P,he,se,K),re<o.length&&(se[2].clone(se[1]),se[2].initializeFromClipResult(o,re,ie),he=x.clipTriangleAtAxisAlignedThreshold(C,p,se[0].getV(),se[1].getV(),se[2].getV(),y),k(c,g,m,U,F,P,he,se,K)))))}const oe=h?-32767:0,ue=p?-32767:0,pe=[],de=[],le=[],ae=[];let fe=Number.MAX_VALUE,ce=-fe;const ge=I;ge.length=0;const me=n.Ellipsoid.clone(e.ellipsoid),xe=n.Rectangle.clone(e.childRectangle),we=xe.north,Ce=xe.south;let Be=xe.east;const ye=xe.west;for(Be<ye&&(Be+=o.CesiumMath.TWO_PI),$=0;$<c.length;++$)te=Math.round(c[$]),te<=d?(pe.push($),te=0):te>=l?(le.push($),te=w):te=2*te+oe,c[$]=te,ne=Math.round(g[$]),ne<=a?(de.push($),ne=0):ne>=f?(ae.push($),ne=w):ne=2*ne+ue,g[$]=ne,Q=o.CesiumMath.lerp(_,j,m[$]/w),Q<fe&&(fe=Q),Q>ce&&(ce=Q),m[$]=Q,A.longitude=o.CesiumMath.lerp(ye,Be,te/w),A.latitude=o.CesiumMath.lerp(Ce,we,ne/w),A.height=Q,me.cartographicToCartesian(A,b),ge.push(b.x),ge.push(b.y),ge.push(b.z);const Ie=t.BoundingSphere.fromVertices(ge,n.Cartesian3.ZERO,3,E),Ae=u.OrientedBoundingBox.fromRectangle(xe,fe,ce,me,H),be=new s.EllipsoidalOccluder(me).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(Ie.center,ge,3,Ie.center,fe,N),ve=ce-fe,Te=new Uint16Array(c.length+g.length+m.length);for($=0;$<c.length;++$)Te[$]=c[$];let ze=c.length;for($=0;$<g.length;++$)Te[ze+$]=g[$];for(ze+=g.length,$=0;$<m.length;++$)Te[ze+$]=w*(m[$]-fe)/ve;const Ve=r.IndexDatatype.createTypedArray(c.length,F);let Me;if(K){const e=new Uint8Array(U);i.push(Te.buffer,Ve.buffer,e.buffer),Me=e.buffer}else i.push(Te.buffer,Ve.buffer);return{vertices:Te.buffer,encodedNormals:Me,indices:Ve.buffer,minimumHeight:fe,maximumHeight:ce,westIndices:pe,southIndices:de,eastIndices:le,northIndices:ae,boundingSphere:Ie,orientedBoundingBox:Ae,horizonOcclusionPoint:be}}))})); | ||
define(["./AttributeCompression-4c4a8822","./Transforms-fdc0a95d","./Matrix2-1ba2543c","./defaultValue-69ee94f4","./TerrainEncoding-365ddcc9","./IndexDatatype-0b020dfb","./RuntimeError-ac440aa5","./ComponentDatatype-07fbb0d4","./OrientedBoundingBox-966209b7","./createTaskProcessorWorker","./_commonjsHelpers-3aae1032-15991586","./combine-0259f56f","./WebGLConstants-f63312fc","./EllipsoidTangentPlane-1cf43e5d","./AxisAlignedBoundingBox-dd1e93db","./IntersectionTests-4547e13f","./Plane-faef0199"],(function(e,t,n,i,s,r,h,o,u,d,p,l,a,f,c,g,m){"use strict";const x={clipTriangleAtAxisAlignedThreshold:function(e,t,n,s,r,h){let o,u,d;i.defined(h)?h.length=0:h=[],t?(o=n<e,u=s<e,d=r<e):(o=n>e,u=s>e,d=r>e);const p=o+u+d;let l,a,f,c,g,m;return 1===p?o?(l=(e-n)/(s-n),a=(e-n)/(r-n),h.push(1),h.push(2),1!==a&&(h.push(-1),h.push(0),h.push(2),h.push(a)),1!==l&&(h.push(-1),h.push(0),h.push(1),h.push(l))):u?(f=(e-s)/(r-s),c=(e-s)/(n-s),h.push(2),h.push(0),1!==c&&(h.push(-1),h.push(1),h.push(0),h.push(c)),1!==f&&(h.push(-1),h.push(1),h.push(2),h.push(f))):d&&(g=(e-r)/(n-r),m=(e-r)/(s-r),h.push(0),h.push(1),1!==m&&(h.push(-1),h.push(2),h.push(1),h.push(m)),1!==g&&(h.push(-1),h.push(2),h.push(0),h.push(g))):2===p?o||n===e?u||s===e?d||r===e||(a=(e-n)/(r-n),f=(e-s)/(r-s),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(a),h.push(-1),h.push(1),h.push(2),h.push(f)):(m=(e-r)/(s-r),l=(e-n)/(s-n),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(m),h.push(-1),h.push(0),h.push(1),h.push(l)):(c=(e-s)/(n-s),g=(e-r)/(n-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(c),h.push(-1),h.push(2),h.push(0),h.push(g)):3!==p&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,s,r,h,o,u,d,p){const l=s-u,a=u-h,f=o-d,c=r-d,g=1/(f*l+a*c),m=t-d,x=e-u,w=(f*x+a*m)*g,C=(-c*x+l*m)*g,B=1-w-C;return i.defined(p)?(p.x=w,p.y=C,p.z=B,p):new n.Cartesian3(w,C,B)},computeLineSegmentLineSegmentIntersection:function(e,t,s,r,h,o,u,d,p){const l=(d-o)*(s-e)-(u-h)*(r-t);if(0===l)return;const a=((u-h)*(t-o)-(d-o)*(e-h))/l,f=((s-e)*(t-o)-(r-t)*(e-h))/l;return a>=0&&a<=1&&f>=0&&f<=1?(i.defined(p)||(p=new n.Cartesian2),p.x=e+a*(s-e),p.y=t+a*(r-t),p):void 0}},w=32767,C=16383,B=[],y=[],I=[],A=new n.Cartographic;let b=new n.Cartesian3;const v=[],T=[],z=[],V=[],M=[],N=new n.Cartesian3,E=new t.BoundingSphere,H=new u.OrientedBoundingBox,R=new n.Cartesian2,O=new n.Cartesian3;function S(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}S.prototype.clone=function(e){return i.defined(e)||(e=new S),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},S.prototype.initializeIndexed=function(e,t,n,i,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},S.prototype.initializeFromClipResult=function(e,t,n){let i=t+1;return-1!==e[t]?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[i]],++i,this.second=n[e[i]],++i,this.ratio=e[i],++i),i},S.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},S.prototype.isIndexed=function(){return i.defined(this.index)},S.prototype.getH=function(){return i.defined(this.index)?this.heightBuffer[this.index]:o.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},S.prototype.getU=function(){return i.defined(this.index)?this.uBuffer[this.index]:o.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},S.prototype.getV=function(){return i.defined(this.index)?this.vBuffer[this.index]:o.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};let U=new n.Cartesian2,F=-1;const P=[new n.Cartesian3,new n.Cartesian3],D=[new n.Cartesian3,new n.Cartesian3];function W(t,i){++F;let s=P[F],r=D[F];return s=e.AttributeCompression.octDecode(t.first.getNormalX(),t.first.getNormalY(),s),r=e.AttributeCompression.octDecode(t.second.getNormalX(),t.second.getNormalY(),r),b=n.Cartesian3.lerp(s,r,t.ratio,b),n.Cartesian3.normalize(b,b),e.AttributeCompression.octEncode(b,i),--F,i}S.prototype.getNormalX=function(){return i.defined(this.index)?this.normalBuffer[2*this.index]:(U=W(this,U),U.x)},S.prototype.getNormalY=function(){return i.defined(this.index)?this.normalBuffer[2*this.index+1]:(U=W(this,U),U.y)};const X=[];function k(e,t,n,s,r,h,o,u,d){if(0===o.length)return;let p=0,l=0;for(;l<o.length;)l=X[p++].initializeFromClipResult(o,l,u);for(let r=0;r<p;++r){const o=X[r];if(o.isIndexed())o.newIndex=h[o.index],o.uBuffer=e,o.vBuffer=t,o.heightBuffer=n,d&&(o.normalBuffer=s);else{const r=o.getKey();if(i.defined(h[r]))o.newIndex=h[r];else{const i=e.length;e.push(o.getU()),t.push(o.getV()),n.push(o.getH()),d&&(s.push(o.getNormalX()),s.push(o.getNormalY())),o.newIndex=i,h[r]=i}}}3===p?(r.push(X[0].newIndex),r.push(X[1].newIndex),r.push(X[2].newIndex)):4===p&&(r.push(X[0].newIndex),r.push(X[1].newIndex),r.push(X[2].newIndex),r.push(X[0].newIndex),r.push(X[2].newIndex),r.push(X[3].newIndex))}return X.push(new S),X.push(new S),X.push(new S),X.push(new S),d((function(e,i){const h=e.isEastChild,d=e.isNorthChild,p=h?C:0,l=h?w:C,a=d?C:0,f=d?w:C,c=v,g=T,m=z,U=M;c.length=0,g.length=0,m.length=0,U.length=0;const F=V;F.length=0;const P={},D=e.vertices;let W=e.indices;W=W.subarray(0,e.indexCountWithoutSkirts);const X=s.TerrainEncoding.clone(e.encoding),K=X.hasVertexNormals;let L=0;const Y=e.vertexCountWithoutSkirts,_=e.minimumHeight,j=e.maximumHeight,G=new Array(Y),J=new Array(Y),Z=new Array(Y),q=K?new Array(2*Y):void 0;let Q,$,ee,te,ne;for($=0,ee=0;$<Y;++$,ee+=2){const e=X.decodeTextureCoordinates(D,$,R);if(Q=X.decodeHeight(D,$),te=o.CesiumMath.clamp(e.x*w|0,0,w),ne=o.CesiumMath.clamp(e.y*w|0,0,w),Z[$]=o.CesiumMath.clamp((Q-_)/(j-_)*w|0,0,w),te<20&&(te=0),ne<20&&(ne=0),w-te<20&&(te=w),w-ne<20&&(ne=w),G[$]=te,J[$]=ne,K){const e=X.getOctEncodedNormal(D,$,O);q[ee]=e.x,q[ee+1]=e.y}(h&&te>=C||!h&&te<=C)&&(d&&ne>=C||!d&&ne<=C)&&(P[$]=L,c.push(te),g.push(ne),m.push(Z[$]),K&&(U.push(q[ee]),U.push(q[ee+1])),++L)}const ie=[];ie.push(new S),ie.push(new S),ie.push(new S);const se=[];let re,he;for(se.push(new S),se.push(new S),se.push(new S),$=0;$<W.length;$+=3){const e=W[$],t=W[$+1],n=W[$+2],i=G[e],s=G[t],r=G[n];ie[0].initializeIndexed(G,J,Z,q,e),ie[1].initializeIndexed(G,J,Z,q,t),ie[2].initializeIndexed(G,J,Z,q,n);const o=x.clipTriangleAtAxisAlignedThreshold(C,h,i,s,r,B);re=0,re>=o.length||(re=se[0].initializeFromClipResult(o,re,ie),re>=o.length||(re=se[1].initializeFromClipResult(o,re,ie),re>=o.length||(re=se[2].initializeFromClipResult(o,re,ie),he=x.clipTriangleAtAxisAlignedThreshold(C,d,se[0].getV(),se[1].getV(),se[2].getV(),y),k(c,g,m,U,F,P,he,se,K),re<o.length&&(se[2].clone(se[1]),se[2].initializeFromClipResult(o,re,ie),he=x.clipTriangleAtAxisAlignedThreshold(C,d,se[0].getV(),se[1].getV(),se[2].getV(),y),k(c,g,m,U,F,P,he,se,K)))))}const oe=h?-32767:0,ue=d?-32767:0,de=[],pe=[],le=[],ae=[];let fe=Number.MAX_VALUE,ce=-fe;const ge=I;ge.length=0;const me=n.Ellipsoid.clone(e.ellipsoid),xe=n.Rectangle.clone(e.childRectangle),we=xe.north,Ce=xe.south;let Be=xe.east;const ye=xe.west;for(Be<ye&&(Be+=o.CesiumMath.TWO_PI),$=0;$<c.length;++$)te=Math.round(c[$]),te<=p?(de.push($),te=0):te>=l?(le.push($),te=w):te=2*te+oe,c[$]=te,ne=Math.round(g[$]),ne<=a?(pe.push($),ne=0):ne>=f?(ae.push($),ne=w):ne=2*ne+ue,g[$]=ne,Q=o.CesiumMath.lerp(_,j,m[$]/w),Q<fe&&(fe=Q),Q>ce&&(ce=Q),m[$]=Q,A.longitude=o.CesiumMath.lerp(ye,Be,te/w),A.latitude=o.CesiumMath.lerp(Ce,we,ne/w),A.height=Q,me.cartographicToCartesian(A,b),ge.push(b.x),ge.push(b.y),ge.push(b.z);const Ie=t.BoundingSphere.fromVertices(ge,n.Cartesian3.ZERO,3,E),Ae=u.OrientedBoundingBox.fromRectangle(xe,fe,ce,me,H),be=new s.EllipsoidalOccluder(me).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(Ie.center,ge,3,Ie.center,fe,N),ve=ce-fe,Te=new Uint16Array(c.length+g.length+m.length);for($=0;$<c.length;++$)Te[$]=c[$];let ze=c.length;for($=0;$<g.length;++$)Te[ze+$]=g[$];for(ze+=g.length,$=0;$<m.length;++$)Te[ze+$]=w*(m[$]-fe)/ve;const Ve=r.IndexDatatype.createTypedArray(c.length,F);let Me;if(K){const e=new Uint8Array(U);i.push(Te.buffer,Ve.buffer,e.buffer),Me=e.buffer}else i.push(Te.buffer,Ve.buffer);return{vertices:Te.buffer,encodedNormals:Me,indices:Ve.buffer,minimumHeight:fe,maximumHeight:ce,westIndices:de,southIndices:pe,eastIndices:le,northIndices:ae,boundingSphere:Ie,orientedBoundingBox:Ae,horizonOcclusionPoint:be}}))})); |
{ | ||
"name": "mars3d-cesium", | ||
"version": "1.93.0", | ||
"version": "1.94.0", | ||
"description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.", | ||
@@ -120,2 +120,3 @@ "homepage": "http://mars3d.cn/", | ||
"build-ts": "gulp build-ts", | ||
"build-third-party": "gulp build-third-party", | ||
"buildApps": "gulp buildApps", | ||
@@ -122,0 +123,0 @@ "clean": "gulp clean", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
13838210
446
51903
11
17
16