qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/PolylineVolumeGeometryLibra...

2 lines
7.5 KiB
JavaScript
Raw Normal View History

2023-11-07 10:04:37 +08:00
define(["exports","./Cartesian2-bd414876","./Cartesian3-e0307675","./Matrix4-4c545f70","./EllipsoidTangentPlane-4d138901","./Math-e73894ab","./PolylinePipeline-0e56eeb9","./Transforms-5b829630","./defaultValue-81eec7ed","./Check-741c5f3c"],(function(e,a,t,n,r,i,s,o,l,c){"use strict";var C=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const u={};function d(e,a){l.defined(u[e])||(u[e]=!0,console.warn(l.defaultValue(a,e)))}d.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.",d.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",d.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",d.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const g=[new t.Cartesian3,new t.Cartesian3],y=new t.Cartesian3,h=new t.Cartesian3,f=new t.Cartesian3,m=new t.Cartesian3,p=new t.Cartesian3,w=new t.Cartesian3,x=new t.Cartesian3,E=new t.Cartesian3,P=new t.Cartesian3,b=new t.Cartesian3,M=new t.Cartesian3,T={};let B=new a.Cartographic;function z(e,a,n,r){const i=e[0],s=e[1],o=t.Cartesian3.angleBetween(i,s),l=Math.ceil(o/r),c=new Array(l);let C;if(a===n){for(C=0;C<l;C++)c[C]=a;return c.push(n),c}const u=(n-a)/l;for(C=1;C<l;C++){const e=a+C*u;c[C]=e}return c[0]=a,c.push(n),c}const S=new t.Cartesian3,A=new t.Cartesian3;const D=new t.Cartesian3(-1,0,0);let R=new n.Matrix4;const O=new n.Matrix4;let V=new n.Matrix3;const I=n.Matrix3.IDENTITY.clone(),N=new t.Cartesian3,v=new n.Cartesian4,G=new t.Cartesian3;function H(e,i,s,l,c,C,u,d){let g=N,y=v;R=o.Transforms.eastNorthUpToFixedFrame(e,c,R),g=n.Matrix4.multiplyByPointAsVector(R,D,g),g=t.Cartesian3.normalize(g,g);const h=function(e,n,i,s){const o=new r.EllipsoidTangentPlane(i,s),l=o.projectPointOntoPlane(t.Cartesian3.add(i,e,S),S),c=o.projectPointOntoPlane(t.Cartesian3.add(i,n,A),A),C=a.Cartesian2.angleBetween(l,c);return c.x*l.y-c.y*l.x>=0?-C:C}(g,i,e,c);V=n.Matrix3.fromRotationZ(h,V),G.z=C,R=n.Matrix4.multiplyTransformation(R,n.Matrix4.fromRotationTranslation(V,G,O),R);const f=I;f[0]=u;for(let e=0;e<d;e++)for(let e=0;e<s.length;e+=3)y=t.Cartesian3.fromArray(s,e,y),y=n.Matrix3.multiplyByVector(f,y,y),y=n.Matrix4.multiplyByPoint(R,y,y),l.push(y.x,y.y,y.z);return l}const L=new t.Cartesian3;function j(e,a,n,r,i,s,o){for(let l=0;l<e.length;l+=3){r=H(t.Cartesian3.fromArray(e,l,L),a,n,r,i,s[l/3],o,1)}return r}function Q(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,s=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-s;return n}const q=new o.Quaternion,F=new t.Cartesian3,U=new n.Matrix3;function _(e,a,r,s,l,c,u,d,g,y){const h=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,b),t.Cartesian3.subtract(r,e,M)),f=s===C.BEVELED?0:Math.ceil(h/i.CesiumMath.toRadians(5));let m,p,w;if(m=l?n.Matrix3.fromQuaternion(o.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,b),h/(f+1),q),U):n.Matrix3.fromQuaternion(o.Quaternion.fromAxisAngle(e,h/(f+1),q),U),a=t.Cartesian3.clone(a,F),f>0){const r=y?2:1;for(let i=0;i<f;i++)a=n.Matrix3.multiplyByVector(m,a,a),p=t.Cartesian3.subtract(a,e,b),p=t.Cartesian3.normalize(p,p),l||(p=t.Cartesian3.negate(p,p)),w=c.scaleToGeodeticSurface(a,M),u=H(w,p,d,u,c,g,1,r)}else p=t.Cartesian3.subtract(a,e,b),p=t.Cartesian3.normalize(p,p),l||(p=t.Cartesian3.negate(p,p)),w=c.scaleToGeodeticSurface(a,M),u=H(w,p,d,u,c,g,1,1),r=t.Cartesian3.clone(r,F),p=t.Cartesian3.subtract(r,e,b),p=t.Cartesian3.normalize(p,p),l||(p=t.Cartesian3.negate(p,p)),w=c.scaleToGeodeticSurface(r,M),u=H(w,p,d,u,c,g,1,1);return u}T.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],s=e[i];a.Cartesian2.equals(t,s)||n.push(s)}return n},T.angleIsGreaterThanPi=function(e,a,n,i){const s=new