1 |
- define(["./when-92c6cf3c","./Rectangle-bab7abf0","./arrayFill-0358accf","./buildModuleUrl-3d15f25c","./Cartographic-67e73ef9","./ComponentDatatype-81047f82","./Check-52a7d806","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryOffsetAttribute-b4d599f5","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PolygonPipeline-b86e8785","./PrimitiveType-cdfe443e","./RectangleGeometryLibrary-12ead223","./Intersect-b97e930a","./Event-3390cd7d","./RuntimeError-c6a62a80","./WebGLConstants-71f10989","./Cartesian2-6033fa5d","./FeatureDetection-067cb23c","./Cartesian4-ad128b5d","./WindingOrder-1b9c8a87","./EllipsoidRhumbLine-8847d1a1"],(function(e,t,i,r,a,n,o,s,u,l,c,h,p,d,f,g,b,_,v,y,m,w,A,E){"use strict";var x=new r.i,D=new r.i,P=new a.t,H=new t.h;function k(e,t){var i=e._ellipsoid,r=t.height,a=t.width,o=t.northCap,l=t.southCap,h=r,p=2,g=0,b=4;o&&(p-=1,h-=1,g+=1,b-=2),l&&(p-=1,h-=1,g+=1,b-=2),g+=p*a+2*h-b;var _,v=new Float64Array(3*g),y=0,m=0,w=P;if(o)f.j.computePosition(t,i,!1,m,0,w),v[y++]=w.x,v[y++]=w.y,v[y++]=w.z;else for(_=0;_<a;_++)f.j.computePosition(t,i,!1,m,_,w),v[y++]=w.x,v[y++]=w.y,v[y++]=w.z;for(_=a-1,m=1;m<r;m++)f.j.computePosition(t,i,!1,m,_,w),v[y++]=w.x,v[y++]=w.y,v[y++]=w.z;if(m=r-1,!l)for(_=a-2;_>=0;_--)f.j.computePosition(t,i,!1,m,_,w),v[y++]=w.x,v[y++]=w.y,v[y++]=w.z;for(_=0,m=r-2;m>0;m--)f.j.computePosition(t,i,!1,m,_,w),v[y++]=w.x,v[y++]=w.y,v[y++]=w.z;for(var A=v.length/3*2,E=c.IndexDatatype.createTypedArray(v.length/3,A),x=0,D=0;D<v.length/3-1;D++)E[x++]=D,E[x++]=D+1;E[x++]=v.length/3-1,E[x++]=0;var H=new s.I({attributes:new u.a,primitiveType:d._0x29ba75.LINES});return H.attributes.position=new s.o({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v}),H.indices=E,H}function L(i){var r=(i=e.u(i,e.u.EMPTY_OBJECT)).rectangle,a=e.u(i.granularity,h.e.RADIANS_PER_DEGREE),n=e.u(i.ellipsoid,t.t.WGS84),s=e.u(i.rotation,0);if(!e.e(r))throw new o.t("rectangle is required.");if(t.h.validate(r),r.north<r.south)throw new o.t("options.rectangle.north must be greater than options.rectangle.south");var u=e.u(i.height,0),l=e.u(i.extrudedHeight,u);this._rectangle=t.h.clone(r),this._granularity=a,this._ellipsoid=n,this._surfaceHeight=Math.max(u,l),this._rotation=s,this._extrudedHeight=Math.min(u,l),this._offsetAttribute=i.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}L.packedLength=t.h.packedLength+t.t.packedLength+5,L.pack=function(i,r,a){if(!e.e(i))throw new o.t("value is required");if(!e.e(r))throw new o.t("array is required");return a=e.u(a,0),t.h.pack(i._rectangle,r,a),a+=t.h.packedLength,t.t.pack(i._ellipsoid,r,a),a+=t.t.packedLength,r[a++]=i._granularity,r[a++]=i._surfaceHeight,r[a++]=i._rotation,r[a++]=i._extrudedHeight,r[a]=e.u(i._offsetAttribute,-1),r};var N=new t.h,G=t.t.clone(t.t.UNIT_SPHERE),I={rectangle:N,ellipsoid:G,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};L.unpack=function(i,r,a){if(!e.e(i))throw new o.t("array is required");r=e.u(r,0);var n=t.h.unpack(i,r,N);r+=t.h.packedLength;var s=t.t.unpack(i,r,G);r+=t.t.packedLength;var u=i[r++],l=i[r++],c=i[r++],h=i[r++],p=i[r];return e.e(a)?(a._rectangle=t.h.clone(n,a._rectangle),a._ellipsoid=t.t.clone(s,a._ellipsoid),a._surfaceHeight=l,a._rotation=c,a._extrudedHeight=h,a._offsetAttribute=-1===p?void 0:p,a):(I.granularity=u,I.height=l,I.rotation=c,I.extrudedHeight=h,I.offsetAttribute=-1===p?void 0:p,new L(I))};var C=new a.t$1;return L.createGeometry=function(t){var a,o,u=t._rectangle,g=t._ellipsoid,b=f.j.computeOptions(u,t._granularity,t._rotation,0,H,C);if(!h.e.equalsEpsilon(u.north,u.south,h.e.EPSILON10)&&!h.e.equalsEpsilon(u.east,u.west,h.e.EPSILON10)){var _,v=t._surfaceHeight,y=t._extrudedHeight;if(!h.e.equalsEpsilon(v,y,0,h.e.EPSILON2)){if(a=function(e,t){var i=e._surfaceHeight,r=e._extrudedHeight,a=e._ellipsoid,n=r,o=i,s=k(e,t),u=t.height,l=t.width,h=p.A.scaleToGeodeticHeight(s.attributes.position.values,o,a,!1),d=h.length,f=new Float64Array(2*d);f.set(h);var g=p.A.scaleToGeodeticHeight(s.attributes.position.values,n,a);f.set(g,d),s.attributes.position.values=f;var b=t.northCap,_=t.southCap,v=4;b&&(v-=1),_&&(v-=1);var y,m=2*(f.length/3+v),w=c.IndexDatatype.createTypedArray(f.length/3,m);d=f.length/6;for(var A=0,E=0;E<d-1;E++)w[A++]=E,w[A++]=E+1,w[A++]=E+d,w[A++]=E+d+1;if(w[A++]=d-1,w[A++]=0,w[A++]=d+d-1,w[A++]=d,w[A++]=0,w[A++]=d,b)y=u-1;else{var x=l-1;w[A++]=x,w[A++]=x+d,y=l+u-2}if(w[A++]=y,w[A++]=y+d,!_){var D=l+y-1;w[A++]=D,w[A]=D+d}return s.indices=w,s}(t,b),e.e(t._offsetAttribute)){var m=a.attributes.position.values.length/3,w=new Uint8Array(m);t._offsetAttribute===l.z.TOP?w=i.d(w,1,0,m/2):(_=t._offsetAttribute===l.z.NONE?0:1,w=i.d(w,_)),a.attributes.applyOffset=new s.o({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}var A=r.i.fromRectangle3D(u,g,v,D),E=r.i.fromRectangle3D(u,g,y,x);o=r.i.union(A,E)}else{if((a=k(t,b)).attributes.position.values=p.A.scaleToGeodeticHeight(a.attributes.position.values,v,g,!1),e.e(t._offsetAttribute)){var P=a.attributes.position.values.length,L=new Uint8Array(P/3);_=t._offsetAttribute===l.z.NONE?0:1,i.d(L,_),a.attributes.applyOffset=new s.o({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}o=r.i.fromRectangle3D(u,g,v)}return new s.I({attributes:a.attributes,indices:a.indices,primitiveType:d._0x29ba75.LINES,boundingSphere:o,offsetAttribute:t._offsetAttribute})}},function(i,r){return e.e(r)&&(i=L.unpack(i,r)),i._ellipsoid=t.t.clone(i._ellipsoid),i._rectangle=t.h.clone(i._rectangle),L.createGeometry(i)}}));
|