2 lines
7.0 KiB
JavaScript
2 lines
7.0 KiB
JavaScript
|
define(["exports","./ArcType-fc72c06c","./GeometryOffsetAttribute-ed56ff58","./BoundingSphere-9a3b5656","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./Cartesian2-bd414876","./EllipsoidTangentPlane-4d138901","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./GeometryInstance-1b39c9e8","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./Math-e73894ab","./PolygonGeometryLibrary-231711c2","./PolygonPipeline-04baeb41"],(function(e,t,i,o,r,n,a,l,s,y,u,p,c,d,g,f,h){"use strict";const m=[],b=[];function P(e,i,o,r,a){const l=s.EllipsoidTangentPlane.fromPoints(i,e).projectPointsOntoPlane(i,m);let c,g;h.PolygonPipeline.computeWindingOrder2D(l)===h.WindingOrder.CLOCKWISE&&(l.reverse(),i=i.slice().reverse());let P=i.length,A=0;if(r)for(c=new Float64Array(2*P*3),g=0;g<P;g++){const e=i[g],t=i[(g+1)%P];c[A++]=e.x,c[A++]=e.y,c[A++]=e.z,c[A++]=t.x,c[A++]=t.y,c[A++]=t.z}else{let r=0;if(a===t.ArcType.GEODESIC)for(g=0;g<P;g++)r+=f.PolygonGeometryLibrary.subdivideLineCount(i[g],i[(g+1)%P],o);else if(a===t.ArcType.RHUMB)for(g=0;g<P;g++)r+=f.PolygonGeometryLibrary.subdivideRhumbLineCount(e,i[g],i[(g+1)%P],o);for(c=new Float64Array(3*r),g=0;g<P;g++){let r;a===t.ArcType.GEODESIC?r=f.PolygonGeometryLibrary.subdivideLine(i[g],i[(g+1)%P],o,b):a===t.ArcType.RHUMB&&(r=f.PolygonGeometryLibrary.subdivideRhumbLine(e,i[g],i[(g+1)%P],o,b));const n=r.length;for(let e=0;e<n;++e)c[A++]=r[e]}}P=c.length/3;const E=2*P,_=d.IndexDatatype.createTypedArray(P,E);for(A=0,g=0;g<P-1;g++)_[A++]=g,_[A++]=g+1;return _[A++]=P-1,_[A++]=0,new p.GeometryInstance({geometry:new y.Geometry({attributes:new u.GeometryAttributes({position:new y.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:y.PrimitiveType.LINES})})}function A(e,i,o,r,a){const l=s.EllipsoidTangentPlane.fromPoints(i,e).projectPointsOntoPlane(i,m);let c,g;h.PolygonPipeline.computeWindingOrder2D(l)===h.WindingOrder.CLOCKWISE&&(l.reverse(),i=i.slice().reverse());let P=i.length;const A=new Array(P);let E=0;if(r)for(c=new Float64Array(2*P*3*2),g=0;g<P;++g){A[g]=E/3;const e=i[g],t=i[(g+1)%P];c[E++]=e.x,c[E++]=e.y,c[E++]=e.z,c[E++]=t.x,c[E++]=t.y,c[E++]=t.z}else{let r=0;if(a===t.ArcType.GEODESIC)for(g=0;g<P;g++)r+=f.PolygonGeometryLibrary.subdivideLineCount(i[g],i[(g+1)%P],o);else if(a===t.ArcType.RHUMB)for(g=0;g<P;g++)r+=f.PolygonGeometryLibrary.subdivideRhumbLineCount(e,i[g],i[(g+1)%P],o);for(c=new Float64Array(3*r*2),g=0;g<P;++g){let r;A[g]=E/3,a===t.ArcType.GEODESIC?r=f.PolygonGeometryLibrary.subdivideLine(i[g],i[(g+1)%P],o,b):a===t.ArcType.RHUMB&&(r=f.PolygonGeometryLibrary.subdivideRhumbLine(e,i[g],i[(g+1)%P],o,b));const n=r.length;for(let e=0;e<n;++e)c[E++]=r[e]}}P=c.length/6;const _=A.length,G=2*(2*P+_),H=d.IndexDatatype.createTypedArray(P+_,G);for(E=0,g=0;g<P;++g)H[E++]=g,H[E++]=(g+1)%P,H[E++]=g+P,H[E++]=(g+1)%P+P;for(g=0;g<_;g++){const e=A[g];H[E++]=e,H[E++]=e+P}return new p.GeometryInstance({geometry:new y.Geometry({attributes:new u.GeometryAttributes({position:new y.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})}),indices:H,primitiveType:y.PrimitiveType.LINES})})}function E(e){const i=e.polygonHierarchy,o=a.defaultValue(e.ellipsoid,l.Ellipsoid.WGS84),r=a.defaultValue(e.granularity,g.CesiumMath.RADIANS_PER_DEGREE),n=a.defaultValue(e.perPositionHeight,!1),s=n&&a.defined(e.extrudedHeight),y=a.defaultValue(e.arcType,t.ArcType.GEODESIC);let u=a.defaultValue(e.height,0),p=a.defaultValue(e.extrudedHeight,u);if(!s){const e=Math.max(u,p);p=Math.min(u,p),u=e}this._ellipsoid=l.Ellipsoid.clone(o),this._granularity=r,this._height=u,this._extrudedHeight=p,this._arcType=y,this._polygonHierarchy=i,this._perPositionHeight=n,this._perPositionHeightExtrude=s,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=f.PolygonGeometryLibrary.computeHierarchyPackedLength(i)+l.Ellipsoid.packedLength+8}E.pack=function(e,t,i){return i=a.defaultValue(i,0),i=f.PolygonGeometryLibrary.packPolygonHierarchy(e.
|