mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-12 09:55:07 -05:00
2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
|
define(["exports","./Matrix2-46444433","./EllipsoidTangentPlane-4deba134","./ComponentDatatype-692a36d3","./PolylinePipeline-3b21ed18","./Transforms-ab7258fe","./when-229515d6","./RuntimeError-608565a6"],(function(e,a,t,n,r,i,o,s){"use strict";var l=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const c={};function C(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const u=[new a.Cartesian3,new a.Cartesian3],d=new a.Cartesian3,g=new a.Cartesian3,y=new a.Cartesian3,m=new a.Cartesian3,h=new a.Cartesian3,f=new a.Cartesian3,p=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3,E=new a.Cartesian3,P=new a.Cartesian3,b={};let M=new a.Cartographic;function T(e,t,n,r){const i=e[0],o=e[1],s=a.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=new Array(l);let C;if(t===n){for(C=0;C<l;C++)c[C]=t;return c.push(n),c}const u=(n-t)/l;for(C=1;C<l;C++){const e=t+C*u;c[C]=e}return c[0]=t,c.push(n),c}const B=new a.Cartesian3,z=new a.Cartesian3;const S=new a.Cartesian3(-1,0,0);let A=new a.Matrix4;const D=new a.Matrix4;let R=new a.Matrix3;const O=a.Matrix3.IDENTITY.clone(),I=new a.Cartesian3,V=new a.Cartesian4,N=new a.Cartesian3;function v(e,n,r,o,s,l,c,C){let u=I,d=V;A=i.Transforms.eastNorthUpToFixedFrame(e,s,A),u=a.Matrix4.multiplyByPointAsVector(A,S,u),u=a.Cartesian3.normalize(u,u);const g=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z),c=a.Cartesian2.angleBetween(s,l);return l.x*s.y-l.y*s.x>=0?-c:c}(u,n,e,s);R=a.Matrix3.fromRotationZ(g,R),N.z=l,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,N,D),A);const y=O;y[0]=c;for(let e=0;e<C;e++)for(let e=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(A,d,d),o.push(d.x,d.y,d.z);return o}const G=new a.Cartesian3;function H(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,G),t,n,r,i,o[l/3],s,1)}return r}function L(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,o=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-o;return n}const j=new i.Quaternion,Q=new a.Cartesian3,q=new a.Matrix3;function F(e,t,r,o,s,c,C,u,d,g){const y=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,E),a.Cartesian3.subtract(r,e,P)),m=o===l.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));let h,f,p;if(h=s?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,E),y/(m+1),j),q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(m+1),j),q),t=a.Cartesian3.clone(t,Q),m>0){const n=g?2:1;for(let r=0;r<m;r++)t=a.Matrix3.multiplyByVector(h,t,t),f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,n)}else f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,1),r=a.Cartesian3.clone(r,Q),f=a.Cartesian3.subtract(r,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(r,P),C=v(p,f,u,C,c,d,1,1);return C}b.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],o=e[i];a.Cartesian2.equals(t,o)||n.push(o)}return n},b.angleIsGreaterThanPi=function(e,n,r,i){const o=new t.EllipsoidTangentPlane(r,i),s=o.projec
|