Files
sdk4_demo/sdk/Cesium/Workers/PolygonPipeline-13f0bfa4.js

26 lines
13 KiB
JavaScript
Raw Normal View History

2025-07-03 15:12:58 +08:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.98
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
define(["exports","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./EllipsoidRhumbLine-0cc30625","./GeometryAttribute-b84ffce6","./WebGLConstants-58abc51a"],(function(e,t,n,r,a,i,o){"use strict";var s={exports:{}};function u(e,t,n){n=n||2;var r,a,i,o,s,u,p,h=t&&t.length,y=h?t[0]*n:e.length,c=x(e,0,y,n,!0),f=[];if(!c||c.next===c.prev)return f;if(h&&(c=function(e,t,n,r){var a,i,o,s=[];for(a=0,i=t.length;a<i;a++)(o=x(e,t[a]*r,a<i-1?t[a+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(g(o));for(s.sort(v),a=0;a<s.length;a++)n=d(s[a],n);return n}(e,t,c,n)),e.length>80*n){r=i=e[0],a=o=e[1];for(var m=n;m<y;m+=n)(s=e[m])<r&&(r=s),(u=e[m+1])<a&&(a=u),s>i&&(i=s),u>o&&(o=u);p=0!==(p=Math.max(i-r,o-a))?32767/p:0}return l(c,f,n,r,a,p,0),f}function x(e,t,n,r,a){var i,o;if(a===O(e,t,n,r)>0)for(i=t;i<n;i+=r)o=D(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=D(i,e[i],e[i+1],o);return o&&S(o,o.next)&&(R(o),o=o.next),o}function p(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!S(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(R(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function l(e,t,n,r,a,i,o){if(e){!o&&i&&function(e,t,n,r){var a=e;do{0===a.z&&(a.z=C(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,o,s,u,x=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,x*=2}while(o>1)}(a)}(e,r,a,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?y(e,r,a,i):h(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),R(e),e=u.next,x=u.next;else if((e=u)===x){o?1===o?l(e=c(p(e),t,n),t,n,r,a,i,2):2===o&&f(e,t,n,r,a,i):l(p(e),t,n,r,a,i,1);break}}}function h(e){var t=e.prev,n=e,r=e.next;if(A(t,n,r)>=0)return!1;for(var a=t.x,i=n.x,o=r.x,s=t.y,u=n.y,x=r.y,p=a<i?a<o?a:o:i<o?i:o,l=s<u?s<x?s:x:u<x?u:x,h=a>i?a>o?a:o:i>o?i:o,y=s>u?s>x?s:x:u>x?u:x,c=r.next;c!==t;){if(c.x>=p&&c.x<=h&&c.y>=l&&c.y<=y&&w(a,s,i,u,o,x,c.x,c.y)&&A(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function y(e,t,n,r){var a=e.prev,i=e,o=e.next;if(A(a,i,o)>=0)return!1;for(var s=a.x,u=i.x,x=o.x,p=a.y,l=i.y,h=o.y,y=s<u?s<x?s:x:u<x?u:x,c=p<l?p<h?p:h:l<h?l:h,f=s>u?s>x?s:x:u>x?u:x,v=p>l?p>h?p:h:l>h?l:h,d=C(y,c,t,n,r),m=C(f,v,t,n,r),g=e.prevZ,b=e.nextZ;g&&g.z>=d&&b&&b.z<=m;){if(g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&w(s,p,u,l,x,h,g.x,g.y)&&A(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,b.x>=y&&b.x<=f&&b.y>=c&&b.y<=v&&b!==a&&b!==o&&w(s,p,u,l,x,h,b.x,b.y)&&A(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;g&&g.z>=d;){if(g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&w(s,p,u,l,x,h,g.x,g.y)&&A(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;b&&b.z<=m;){if(b.x>=y&&b.x<=f&&b.y>=c&&b.y<=v&&b!==a&&b!==o&&w(s,p,u,l,x,h,b.x,b.y)&&A(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!S(a,i)&&E(a,r,r.next,i)&&z(a,i)&&z(i,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),R(r),R(r.next),r=e=i),r=r.next}while(r!==e);return p(r)}function f(e,t,n,r,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&b(o,s)){var u=L(o,s);return o=p(o,o.next),u=p(u,u.next),l(o,t,n,r,a,i,0),void l(u,t,n,r,a,i,0)}s=s.next}o=o.next}while(o!==e)}function v(e,t){return e.x-t.x}function d(e,t){var n=function(e,t){var n,r=t,a=e.x,i=e.y,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=a&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===a))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,p=n.x,l=n.y,h=1/0;r=n;do{a>=r.x&&r.x>=p&&a!==r.x&&w(i<l?a:o,i,p,l,i<l?o:a,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(a-r.x),z(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&m(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=L(n,e);return p(r,r.next),p(n,n.next)}function m(e,t){return A(e.prev,e,t.prev)<0&&A(t.next,e,e.next)<0}function C(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*a|0)|e<<8)