integrated_traffic_vue/public/lib/Cesium/Workers/createPolygonOutlineGeometr...

2 lines
7.4 KiB
JavaScript
Raw Normal View History

2024-01-31 09:03:02 +08:00
define(["./defaultValue-0a909f67","./Matrix3-b6f074fa","./ArcType-ce2e50ab","./Transforms-713aa3a8","./ComponentDatatype-77274976","./EllipsoidTangentPlane-8eee3c2f","./GeometryAttribute-0b8b7b82","./GeometryAttributes-f06a2792","./GeometryInstance-9b27c40d","./GeometryOffsetAttribute-04332ce7","./GeometryPipeline-b6eb7525","./IndexDatatype-2149f06c","./Math-e97915da","./PolygonGeometryLibrary-af483c87","./PolygonPipeline-1b86ab0c","./Matrix2-163b5a1d","./RuntimeError-06c93819","./combine-ca22a614","./WebGLConstants-a8cc3e8c","./AxisAlignedBoundingBox-c7183545","./IntersectionTests-87baf287","./Plane-1c5a21a3","./AttributeCompression-e18a879a","./EncodedCartesian3-de837603","./arrayRemoveDuplicates-e9673044","./EllipsoidRhumbLine-7f84cca0"],(function(e,t,i,o,r,n,a,s,l,y,u,p,c,d,f,g,m,h,b,P,E,A,_,G,L,T){"use strict";const H=[],v=[];function C(e,t,o,y,u){const c=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(c)===f.WindingOrder.CLOCKWISE&&(c.reverse(),t=t.slice().reverse());let h=t.length,b=0;if(y)for(g=new Float64Array(2*h*3),m=0;m<h;m++){const e=t[m],i=t[(m+1)%h];g[b++]=e.x,g[b++]=e.y,g[b++]=e.z,g[b++]=i.x,g[b++]=i.y,g[b++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(m=0;m<h;m++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],o);else if(u===i.ArcType.RHUMB)for(m=0;m<h;m++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],o);for(g=new Float64Array(3*r),m=0;m<h;m++){let r;u===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],o,v):u===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],o,v));const n=r.length;for(let e=0;e<n;++e)g[b++]=r[e]}}h=g.length/3;const P=2*h,E=p.IndexDatatype.createTypedArray(h,P);for(b=0,m=0;m<h-1;m++)E[b++]=m,E[b++]=m+1;return E[b++]=h-1,E[b++]=0,new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:E,primitiveType:a.PrimitiveType.LINES})})}function x(e,t,o,y,u){const c=n.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,H);let g,m;f.PolygonPipeline.computeWindingOrder2D(c)===f.WindingOrder.CLOCKWISE&&(c.reverse(),t=t.slice().reverse());let h=t.length;const b=new Array(h);let P=0;if(y)for(g=new Float64Array(2*h*3*2),m=0;m<h;++m){b[m]=P/3;const e=t[m],i=t[(m+1)%h];g[P++]=e.x,g[P++]=e.y,g[P++]=e.z,g[P++]=i.x,g[P++]=i.y,g[P++]=i.z}else{let r=0;if(u===i.ArcType.GEODESIC)for(m=0;m<h;m++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],o);else if(u===i.ArcType.RHUMB)for(m=0;m<h;m++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],o);for(g=new Float64Array(3*r*2),m=0;m<h;++m){let r;b[m]=P/3,u===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],o,v):u===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],o,v));const n=r.length;for(let e=0;e<n;++e)g[P++]=r[e]}}h=g.length/6;const E=b.length,A=2*(2*h+E),_=p.IndexDatatype.createTypedArray(h+E,A);for(P=0,m=0;m<h;++m)_[P++]=m,_[P++]=(m+1)%h,_[P++]=m+h,_[P++]=(m+1)%h+h;for(m=0;m<E;m++){const e=b[m];_[P++]=e,_[P++]=e+h}return new l.GeometryInstance({geometry:new a.Geometry({attributes:new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:g})}),indices:_,primitiveType:a.PrimitiveType.LINES})})}function O(o){const r=o.polygonHierarchy,n=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),a=e.defaultValue(o.granularity,c.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(o.perPositionHeight,!1),l=s&&e.defined(o.extrudedHeight),y=e.defaultValue(o.arcType,i.ArcType.GEODESIC);let u=e.defaultValue(o.height,0),p=e.defaultValue(o.extrudedHeight,u);if(!l){const e=Math.max(u,p);p=Math.min(u,p),u=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=a,this._height=u,this._extrudedHeight=p,this._arcType=y,this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrud