1 |
- define(["./when-92c6cf3c","./Rectangle-bab7abf0","./ArcType-31298545","./arrayFill-0358accf","./buildModuleUrl-3d15f25c","./Check-52a7d806","./ComponentDatatype-81047f82","./EllipsoidTangentPlane-53184efd","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryInstance-da5e91bc","./GeometryOffsetAttribute-b4d599f5","./GeometryPipeline-f4eddf07","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PolygonGeometryLibrary-7c66403e","./PolygonPipeline-b86e8785","./PrimitiveType-cdfe443e","./WindingOrder-1b9c8a87","./Cartographic-67e73ef9","./Intersect-b97e930a","./Event-3390cd7d","./RuntimeError-c6a62a80","./WebGLConstants-71f10989","./Cartesian2-6033fa5d","./Cartesian4-ad128b5d","./IntersectionTests-a42760d9","./Plane-f8d22530","./FeatureDetection-067cb23c","./AttributeCompression-49f7b62a","./EncodedCartesian3-b86c8d65","./arrayRemoveDuplicates-f7eaafa2","./EllipsoidRhumbLine-8847d1a1"],(function(e,t,i,r,o,n,a,s,p,u,y,d,c,l,h,f,g,b,m,v,_,E,H,P,A,L,T,C,D,I,O,w,x){"use strict";var G=[],R=[];function S(e,t,r,o,n){var d=s.f.fromPoints(t,e).projectPointsOntoPlane(t,G);g.A.computeWindingOrder2D(d)===m.W.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());var c,h,v=t.length,_=0;if(o)for(c=new Float64Array(2*v*3),h=0;h<v;h++){var E=t[h],H=t[(h+1)%v];c[_++]=E.x,c[_++]=E.y,c[_++]=E.z,c[_++]=H.x,c[_++]=H.y,c[_++]=H.z}else{var P=0;if(n===i.L.GEODESIC)for(h=0;h<v;h++)P+=f.y.subdivideLineCount(t[h],t[(h+1)%v],r);else if(n===i.L.RHUMB)for(h=0;h<v;h++)P+=f.y.subdivideRhumbLineCount(e,t[h],t[(h+1)%v],r);for(c=new Float64Array(3*P),h=0;h<v;h++){var A;n===i.L.GEODESIC?A=f.y.subdivideLine(t[h],t[(h+1)%v],r,R):n===i.L.RHUMB&&(A=f.y.subdivideRhumbLine(e,t[h],t[(h+1)%v],r,R));for(var L=A.length,T=0;T<L;++T)c[_++]=A[T]}}var C=2*(v=c.length/3),D=l.IndexDatatype.createTypedArray(v,C);for(_=0,h=0;h<v-1;h++)D[_++]=h,D[_++]=h+1;return D[_++]=v-1,D[_++]=0,new y.d({geometry:new p.I({attributes:new u.a({position:new p.o({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})}),indices:D,primitiveType:b._0x29ba75.LINES})})}function k(e,t,r,o,n){var d=s.f.fromPoints(t,e).projectPointsOntoPlane(t,G);g.A.computeWindingOrder2D(d)===m.W.CLOCKWISE&&(d.reverse(),t=t.slice().reverse());var c,h,v=t.length,_=new Array(v),E=0;if(o)for(c=new Float64Array(2*v*3*2),h=0;h<v;++h){_[h]=E/3;var H=t[h],P=t[(h+1)%v];c[E++]=H.x,c[E++]=H.y,c[E++]=H.z,c[E++]=P.x,c[E++]=P.y,c[E++]=P.z}else{var A=0;if(n===i.L.GEODESIC)for(h=0;h<v;h++)A+=f.y.subdivideLineCount(t[h],t[(h+1)%v],r);else if(n===i.L.RHUMB)for(h=0;h<v;h++)A+=f.y.subdivideRhumbLineCount(e,t[h],t[(h+1)%v],r);for(c=new Float64Array(3*A*2),h=0;h<v;++h){var L;_[h]=E/3,n===i.L.GEODESIC?L=f.y.subdivideLine(t[h],t[(h+1)%v],r,R):n===i.L.RHUMB&&(L=f.y.subdivideRhumbLine(e,t[h],t[(h+1)%v],r,R));for(var T=L.length,C=0;C<T;++C)c[E++]=L[C]}}v=c.length/6;var D=_.length,I=2*(2*v+D),O=l.IndexDatatype.createTypedArray(v,I);for(E=0,h=0;h<v;++h)O[E++]=h,O[E++]=(h+1)%v,O[E++]=h+v,O[E++]=(h+1)%v+v;for(h=0;h<D;h++){var w=_[h];O[E++]=w,O[E++]=w+v}return new y.d({geometry:new p.I({attributes:new u.a({position:new p.o({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})}),indices:O,primitiveType:b._0x29ba75.LINES})})}function N(r){if(n.o.typeOf.object("options",r),n.o.typeOf.object("options.polygonHierarchy",r.polygonHierarchy),r.perPositionHeight&&e.e(r.height))throw new n.t("Cannot use both options.perPositionHeight and options.height");if(e.e(r.arcType)&&r.arcType!==i.L.GEODESIC&&r.arcType!==i.L.RHUMB)throw new n.t("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");var o=r.polygonHierarchy,a=e.u(r.ellipsoid,t.t.WGS84),s=e.u(r.granularity,h.e.RADIANS_PER_DEGREE),p=e.u(r.perPositionHeight,!1),u=p&&e.e(r.extrudedHeight),y=e.u(r.arcType,i.L.GEODESIC),d=e.u(r.height,0),c=e.u(r.extrudedHeight,d);if(!u){var l=Math.max(d,c);c=Math.min(d,c),d=l}this._ellipsoid=t.t.clone(a),this._granularity=s,this._height=d,this._extrudedHeight=c,this._arcType=y,this._polygonHierarchy=o,this._perPositionHeight=p,this._perPositionHeightExtrude=u,this._offsetAttribute=r.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=f.y.computeHierarchyPackedLength(o)+t.t.packedLength+8}N.pack=function(i,r,o){return n.o.typeOf.object("value",i),n.o.defined("array",r),o=e.u(o,0),o=f.y.packPolygonHierarchy(i._polygonHierarchy,r,o),t.t.pack(i._ellipsoid,r,o),o+=t.t.packedLength,r[o++]=i._height,r[o++]=i._extrudedHeight,r[o++]=i._granularity,r[o++]=i._perPositionHeightExtrude?1:0,r[o++]=i._perPositionHeight?1:0,r[o++]=i._arcType,r[o++]=e.u(i._offsetAttribute,-1),r[o]=i.packedLength,r};var U=t.t.clone(t.t.UNIT_SPHERE),B={polygonHierarchy:{}};return N.unpack=function(i,r,o){n.o.defined("array",i),r=e.u(r,0);var a=f.y.unpackPolygonHierarchy(i,r);r=a.startingIndex,delete a.startingIndex;var s=t.t.unpack(i,r,U);r+=t.t.packedLength;var p=i[r++],u=i[r++],y=i[r++],d=1===i[r++],c=1===i[r++],l=i[r++],h=i[r++],g=i[r];return e.e(o)||(o=new N(B)),o._polygonHierarchy=a,o._ellipsoid=t.t.clone(s,o._ellipsoid),o._height=p,o._extrudedHeight=u,o._granularity=y,o._perPositionHeight=c,o._perPositionHeightExtrude=d,o._arcType=l,o._offsetAttribute=-1===h?void 0:h,o.packedLength=g,o},N.fromPositions=function(t){return t=e.u(t,e.u.EMPTY_OBJECT),n.o.defined("options.positions",t.positions),new N({polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute})},N.createGeometry=function(t){var i=t._ellipsoid,n=t._granularity,s=t._polygonHierarchy,u=t._perPositionHeight,y=t._arcType,l=f.y.polygonOutlinesFromHierarchy(s,!u,i);if(0!==l.length){var b,m,v,_=[],E=h.e.chordLength(n,i.maximumRadius),H=t._height,P=t._extrudedHeight;if(t._perPositionHeightExtrude||!h.e.equalsEpsilon(H,P,0,h.e.EPSILON2))for(v=0;v<l.length;v++){if((b=k(i,l[v],E,u,y)).geometry=f.y.scaleToGeodeticHeightExtruded(b.geometry,H,P,i,u),e.e(t._offsetAttribute)){var A=b.geometry.attributes.position.values.length/3,L=new Uint8Array(A);t._offsetAttribute===d.z.TOP?L=r.d(L,1,0,A/2):(m=t._offsetAttribute===d.z.NONE?0:1,L=r.d(L,m)),b.geometry.attributes.applyOffset=new p.o({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}_.push(b)}else for(v=0;v<l.length;v++){if((b=S(i,l[v],E,u,y)).geometry.attributes.position.values=g.A.scaleToGeodeticHeight(b.geometry.attributes.position.values,H,i,!u),e.e(t._offsetAttribute)){var T=b.geometry.attributes.position.values.length,C=new Uint8Array(T/3);m=t._offsetAttribute===d.z.NONE?0:1,r.d(C,m),b.geometry.attributes.applyOffset=new p.o({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}_.push(b)}var D=c.k.combineInstances(_)[0],I=o.i.fromVertices(D.attributes.position.values);return new p.I({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:I,offsetAttribute:t._offsetAttribute})}},function(i,r){return e.e(r)&&(i=N.unpack(i,r)),i._ellipsoid=t.t.clone(i._ellipsoid),N.createGeometry(i)}}));
|