/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 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/master/LICENSE.md for full licensing details. */ define(["exports"],function(e){function n(e,n,t){t=t||2;var r,x,i,v,u,f,y,o=n&&n.length,p=o?n[0]*t:e.length,a=s(e,0,p,t,!0),h=[];if(!a||a.next===a.prev)return h;if(o&&(a=function(e,n,t,r){var x,i,v,u,f,y=[];for(x=0,i=n.length;x80*t){r=i=e[0],x=v=e[1];for(var l=t;l
i.x?x.x>v.x?x.x:v.x:i.x>v.x?i.x:v.x,o=x.y>i.y?x.y>v.y?x.y:v.y:i.y>v.y?i.y:v.y,p=M(u,f,n,t,r),a=M(y,o,n,t,r),h=e.prevZ,l=e.nextZ;h&&h.z>=p&&l&&l.z<=a;){if(h!==e.prev&&h!==e.next&&z(x.x,x.y,i.x,i.y,v.x,v.y,h.x,h.y)&&0<=b(h.prev,h,h.next))return!1;if(h=h.prevZ,l!==e.prev&&l!==e.next&&z(x.x,x.y,i.x,i.y,v.x,v.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;l=l.nextZ}for(;h&&h.z>=p;){if(h!==e.prev&&h!==e.next&&z(x.x,x.y,i.x,i.y,v.x,v.y,h.x,h.y)&&0<=b(h.prev,h,h.next))return!1;h=h.prevZ}for(;l&&l.z<=a;){if(l!==e.prev&&l!==e.next&&z(x.x,x.y,i.x,i.y,v.x,v.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;l=l.nextZ}return!0}function a(e,n,t){var r=e;do{var x=r.prev,i=r.next.next;!l(x,i)&&m(x,r,r.next,i)&&k(x,i)&&k(i,x)&&(n.push(x.i/t),n.push(r.i/t),n.push(i.i/t),q(r),q(r.next),r=e=i),r=r.next}while(r!==e);return c(r)}function h(e,n,t,r,x,i){var v,u,f=e;do{for(var y=f.next.next;y!==f.prev;){if(f.i!==y.i&&(u=y,(v=f).next.i!==u.i&&v.prev.i!==u.i&&!function(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&m(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(v,u)&&(k(v,u)&&k(u,v)&&function(e,n){var t=e,r=!1,x=(e.x+n.x)/2,i=(e.y+n.y)/2;for(;t.y>i!=t.next.y>i&&t.next.y!==t.y&&x<(t.next.x-t.x)*(i-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next,t!==e;);return r}(v,u)&&(b(v.prev,v,u.prev)||b(v,u.prev,u))||l(v,u)&&0=r.next.y&&r.next.y!==r.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=x&&v=r.x&&r.x>=o&&x!==r.x&&z(i
t.x||r.x===t.x&&(l=r,b((h=t).prev,h,l.prev)<0&&b(l.next,h,h.next)<0)))&&(t=r,a=f)),r=r.next,r!==y;);var h,l;return t}(e,n)){var t=j(n,e);c(t,t.next)}}function M(e,n,t,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*x)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*x)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function w(e){for(var n=e,t=e;(n.x