qd-changjing/public/static/Build/Cesium/Workers/createPolygonOutlineGeometr...

2 lines
7.3 KiB
JavaScript
Raw Normal View History

2022-07-05 16:56:29 +08:00
define(["./when-4bbc8319","./Matrix2-c6c16658","./ArcType-fc72c06c","./GeometryOffsetAttribute-821af768","./Transforms-f15de320","./RuntimeError-5b082e8f","./ComponentDatatype-3d0a0aac","./EllipsoidTangentPlane-41514392","./GeometryAttribute-8350368e","./GeometryAttributes-7827a6c2","./GeometryInstance-0b07c761","./GeometryPipeline-0fb7cb2c","./IndexDatatype-ddbc25a7","./PolygonGeometryLibrary-a02d6b0b","./PolygonPipeline-ff4d4077","./combine-e9466e32","./WebGLConstants-508b9636","./AxisAlignedBoundingBox-a572809f","./IntersectionTests-a4e54d9a","./Plane-26e67b94","./AttributeCompression-f7a901f9","./EncodedCartesian3-b1495e46","./arrayRemoveDuplicates-80a91d16","./EllipsoidRhumbLine-c6741351"],(function(e,t,i,r,o,n,a,s,l,y,u,p,d,c,g,f,m,h,b,P,E,A,_,G){"use strict";const L=[],T=[];function H(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,L);let f,m;g.PolygonPipeline.computeWindingOrder2D(p)===g.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length,b=0;if(o)for(f=new Float64Array(2*h*3),m=0;m<h;m++){const e=t[m],i=t[(m+1)%h];f[b++]=e.x,f[b++]=e.y,f[b++]=e.z,f[b++]=i.x,f[b++]=i.y,f[b++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(f=new Float64Array(3*o),m=0;m<h;m++){let o;n===i.ArcType.GEODESIC?o=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,T):n===i.ArcType.RHUMB&&(o=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,T));const a=o.length;for(let e=0;e<a;++e)f[b++]=o[e]}}h=f.length/3;const P=2*h,E=d.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 u.GeometryInstance({geometry:new l.Geometry({attributes:new y.GeometryAttributes({position:new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:E,primitiveType:l.PrimitiveType.LINES})})}function v(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,L);let f,m;g.PolygonPipeline.computeWindingOrder2D(p)===g.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length;const b=new Array(h);let P=0;if(o)for(f=new Float64Array(2*h*3*2),m=0;m<h;++m){b[m]=P/3;const e=t[m],i=t[(m+1)%h];f[P++]=e.x,f[P++]=e.y,f[P++]=e.z,f[P++]=i.x,f[P++]=i.y,f[P++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(f=new Float64Array(3*o*2),m=0;m<h;++m){let o;b[m]=P/3,n===i.ArcType.GEODESIC?o=c.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,T):n===i.ArcType.RHUMB&&(o=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,T));const a=o.length;for(let e=0;e<a;++e)f[P++]=o[e]}}h=f.length/6;const E=b.length,A=2*(2*h+E),_=d.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 u.GeometryInstance({geometry:new l.Geometry({attributes:new y.GeometryAttributes({position:new l.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:_,primitiveType:l.PrimitiveType.LINES})})}function O(r){const o=r.polygonHierarchy,n=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),s=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(r.perPositionHeight,!1),y=l&&e.defined(r.extrudedHeight),u=e.defaultValue(r.arcType,i.ArcType.GEODESIC);let p=e.defaultValue(r.height,0),d=e.defaultValue(r.extrudedHeight,p);if(!y){const e=Math.max(p,d);d=Math.min(p,d),p=e}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=s,this._height=p,this._extrudedHeight=d,this._arcType=u,this._polygonHierarchy=o,this._perPositionHeight=l,this._perPositionHeightExtrude=y,this._offsetAttribute=r.offsetAttribute,this._w