2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
|
define(["./defaultValue-81eec7ed","./Matrix2-e3fb4559","./ArcType-fc72c06c","./GeometryOffsetAttribute-ed56ff58","./Transforms-98ffa11d","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./EllipsoidTangentPlane-fa1337e1","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./GeometryInstance-ce434bcb","./GeometryPipeline-4b426993","./IndexDatatype-f1e3f799","./Math-5f585871","./PolygonGeometryLibrary-8f834b9d","./PolygonPipeline-6f83d8b1","./Cartesian3-7e9cc2ff","./Matrix4-d34187af","./RuntimeError-26acdd3b","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./WebGLConstants-508b9636","./AxisAlignedBoundingBox-37250ed6","./IntersectionTests-73b87d72","./Plane-4f75b3df","./AttributeCompression-e2e3f0dd","./EncodedCartesian3-aac44514","./arrayRemoveDuplicates-85770175","./EllipsoidRhumbLine-9c6b32ea"],(function(e,t,i,r,o,n,a,s,l,y,u,p,d,c,f,g,m,h,b,P,E,A,_,G,L,H,T,v,x){"use strict";const C=[],O=[];function D(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,C);let c,m;g.PolygonPipeline.computeWindingOrder2D(p)===g.WindingOrder.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let h=t.length,b=0;if(o)for(c=new Float64Array(2*h*3),m=0;m<h;m++){const e=t[m],i=t[(m+1)%h];c[b++]=e.x,c[b++]=e.y,c[b++]=e.z,c[b++]=i.x,c[b++]=i.y,c[b++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=f.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=f.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(c=new Float64Array(3*o),m=0;m<h;m++){let o;n===i.ArcType.GEODESIC?o=f.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,O):n===i.ArcType.RHUMB&&(o=f.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,O));const a=o.length;for(let e=0;e<a;++e)c[b++]=o[e]}}h=c.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:c})}),indices:E,primitiveType:l.PrimitiveType.LINES})})}function I(e,t,r,o,n){const p=s.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,C);let c,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(c=new Float64Array(2*h*3*2),m=0;m<h;++m){b[m]=P/3;const e=t[m],i=t[(m+1)%h];c[P++]=e.x,c[P++]=e.y,c[P++]=e.z,c[P++]=i.x,c[P++]=i.y,c[P++]=i.z}else{let o=0;if(n===i.ArcType.GEODESIC)for(m=0;m<h;m++)o+=f.PolygonGeometryLibrary.subdivideLineCount(t[m],t[(m+1)%h],r);else if(n===i.ArcType.RHUMB)for(m=0;m<h;m++)o+=f.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[m],t[(m+1)%h],r);for(c=new Float64Array(3*o*2),m=0;m<h;++m){let o;b[m]=P/3,n===i.ArcType.GEODESIC?o=f.PolygonGeometryLibrary.subdivideLine(t[m],t[(m+1)%h],r,O):n===i.ArcType.RHUMB&&(o=f.PolygonGeometryLibrary.subdivideRhumbLine(e,t[m],t[(m+1)%h],r,O));const a=o.length;for(let e=0;e<a;++e)c[P++]=o[e]}}h=c.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:c})}),indices:_,primitiveType:l.PrimitiveType.LINES})})}function w(r){const o=r.polygonHierarchy,n=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),a=e.defaultValue(r.granularity,c.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(r.perPositionHeight,!1),l=s&&e.defined(r.extrudedHeight),y=e.defaultValue(r.arcType,i.ArcType.GEODESIC);let u=e.defaultValue(r.height,0),p=e.defaultValue(r.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._ar
|