/** * 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","./when-60b00257","./Check-4274a1fd","./Math-9d37f659","./Cartesian2-2951f601","./WebGLConstants-779bf0bc","./ComponentDatatype-a29c6075","./GeometryAttribute-2f728681","./EllipsoidRhumbLine-cbcd6a13"],function(e,T,t,W,P,n,I,B,N){"use strict";function r(e,t,n){n=n||2;var r,a,i,x,u,o,s,p=t&&t.length,h=p?t[0]*n:e.length,f=l(e,0,h,n,!0),y=[];if(!f||f.next===f.prev)return y;if(p&&(f=function(e,t,n,r){var a,i,x,u,o,s=[];for(a=0,i=t.length;a80*n){r=i=e[0],a=x=e[1];for(var v=n;vi.x?a.x>x.x?a.x:x.x:i.x>x.x?i.x:x.x,p=a.y>i.y?a.y>x.y?a.y:x.y:i.y>x.y?i.y:x.y,h=g(u,o,t,n,r),f=g(s,p,t,n,r),y=e.prevZ,v=e.nextZ;y&&y.z>=h&&v&&v.z<=f;){if(y!==e.prev&&y!==e.next&&w(a.x,a.y,i.x,i.y,x.x,x.y,y.x,y.y)&&0<=E(y.prev,y,y.next))return;if(y=y.prevZ,v!==e.prev&&v!==e.next&&w(a.x,a.y,i.x,i.y,x.x,x.y,v.x,v.y)&&0<=E(v.prev,v,v.next))return;v=v.nextZ}for(;y&&y.z>=h;){if(y!==e.prev&&y!==e.next&&w(a.x,a.y,i.x,i.y,x.x,x.y,y.x,y.y)&&0<=E(y.prev,y,y.next))return;y=y.prevZ}for(;v&&v.z<=f;){if(v!==e.prev&&v!==e.next&&w(a.x,a.y,i.x,i.y,x.x,x.y,v.x,v.y)&&0<=E(v.prev,v,v.next))return;v=v.nextZ}return 1}}function f(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!v(a,i)&&M(a,r,r.next,i)&&Z(a,i)&&Z(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),A(r),A(r.next),r=e=i),r=r.next}while(r!==e);return c(r)}function y(e,t,n,r,a,i){var x,u,o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&(u=s,(x=o).next.i!==u.i&&x.prev.i!==u.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&M(n,n.next,e,t))return 1;n=n.next}while(n!==e);return}(x,u)&&(Z(x,u)&&Z(u,x)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;for(;n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(x,u)&&(E(x.prev,x,u.prev)||E(x,u.prev,u))||v(x,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<=a&&x=r.x&&r.x>=p&&a!==r.x&&w(in.x||r.x===n.x&&(v=r,E((y=n).prev,y,v.prev)<0&&E(v.next,y,y.next)<0)))&&(n=r,f=o)),r=r.next,r!==s;);var y,v;return n}(e,t)){var n=S(t,e);c(n,n.next)}}function g(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function b(e){for(var t=e,n=e;(t.x=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function s(e){return 0