1 |
- define(["exports","./arrayFill-0358accf","./buildModuleUrl-3d15f25c","./Cartographic-67e73ef9","./ComponentDatatype-81047f82","./when-92c6cf3c","./Check-52a7d806","./Rectangle-bab7abf0","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryOffsetAttribute-b4d599f5","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PrimitiveType-cdfe443e"],(function(t,i,e,o,n,r,a,s,m,u,f,c,d,l){"use strict";var _=new o.t(1,1,1),h=Math.cos,p=Math.sin;function b(t){t=r.u(t,r.u.EMPTY_OBJECT);var i=r.u(t.radii,_),e=r.u(t.innerRadii,i),n=r.u(t.minimumClock,0),s=r.u(t.maximumClock,d.e.TWO_PI),m=r.u(t.minimumCone,0),u=r.u(t.maximumCone,d.e.PI),c=Math.round(r.u(t.stackPartitions,10)),l=Math.round(r.u(t.slicePartitions,8)),h=Math.round(r.u(t.subdivisions,128));if(c<1)throw new a.t("options.stackPartitions cannot be less than 1");if(l<0)throw new a.t("options.slicePartitions cannot be less than 0");if(h<0)throw new a.t("options.subdivisions must be greater than or equal to zero.");if(r.e(t.offsetAttribute)&&t.offsetAttribute===f.z.TOP)throw new a.t("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=o.t.clone(i),this._innerRadii=o.t.clone(e),this._minimumClock=n,this._maximumClock=s,this._minimumCone=m,this._maximumCone=u,this._stackPartitions=c,this._slicePartitions=l,this._subdivisions=h,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}b.packedLength=2*o.t.packedLength+8,b.pack=function(t,i,e){if(!r.e(t))throw new a.t("value is required");if(!r.e(i))throw new a.t("array is required");return e=r.u(e,0),o.t.pack(t._radii,i,e),e+=o.t.packedLength,o.t.pack(t._innerRadii,i,e),e+=o.t.packedLength,i[e++]=t._minimumClock,i[e++]=t._maximumClock,i[e++]=t._minimumCone,i[e++]=t._maximumCone,i[e++]=t._stackPartitions,i[e++]=t._slicePartitions,i[e++]=t._subdivisions,i[e]=r.u(t._offsetAttribute,-1),i};var v=new o.t,k=new o.t,y={radii:v,innerRadii:k,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};b.unpack=function(t,i,e){if(!r.e(t))throw new a.t("array is required");i=r.u(i,0);var n=o.t.unpack(t,i,v);i+=o.t.packedLength;var s=o.t.unpack(t,i,k);i+=o.t.packedLength;var m=t[i++],u=t[i++],f=t[i++],c=t[i++],d=t[i++],l=t[i++],_=t[i++],h=t[i];return r.e(e)?(e._radii=o.t.clone(n,e._radii),e._innerRadii=o.t.clone(s,e._innerRadii),e._minimumClock=m,e._maximumClock=u,e._minimumCone=f,e._maximumCone=c,e._stackPartitions=d,e._slicePartitions=l,e._subdivisions=_,e._offsetAttribute=-1===h?void 0:h,e):(y.minimumClock=m,y.maximumClock=u,y.minimumCone=f,y.maximumCone=c,y.stackPartitions=d,y.slicePartitions=l,y.subdivisions=_,y.offsetAttribute=-1===h?void 0:h,new b(y))},b.createGeometry=function(t){var o=t._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var _=t._minimumClock,b=t._maximumClock,v=t._minimumCone,k=t._maximumCone,y=t._subdivisions,C=s.t.fromCartesian3(o),w=t._slicePartitions+1,x=t._stackPartitions+1;(w=Math.round(w*Math.abs(b-_)/d.e.TWO_PI))<2&&(w=2),(x=Math.round(x*Math.abs(k-v)/d.e.PI))<2&&(x=2);var P=0,A=1,g=a.x!==o.x||a.y!==o.y||a.z!==o.z,M=!1,z=!1;g&&(A=2,v>0&&(M=!0,P+=w),k<Math.PI&&(z=!0,P+=w));var O,I,T,D,E=y*A*(x+w),L=new Float64Array(3*E),R=2*(E+P-(w+x)*A),G=c.IndexDatatype.createTypedArray(E,R),N=0,q=new Array(x),U=new Array(x);for(O=0;O<x;O++)D=v+O*(k-v)/(x-1),q[O]=p(D),U[O]=h(D);var B=new Array(y),S=new Array(y);for(O=0;O<y;O++)T=_+O*(b-_)/(y-1),B[O]=p(T),S[O]=h(T);for(O=0;O<x;O++)for(I=0;I<y;I++)L[N++]=o.x*q[O]*S[I],L[N++]=o.y*q[O]*B[I],L[N++]=o.z*U[O];if(g)for(O=0;O<x;O++)for(I=0;I<y;I++)L[N++]=a.x*q[O]*S[I],L[N++]=a.y*q[O]*B[I],L[N++]=a.z*U[O];for(q.length=y,U.length=y,O=0;O<y;O++)D=v+O*(k-v)/(y-1),q[O]=p(D),U[O]=h(D);for(B.length=w,S.length=w,O=0;O<w;O++)T=_+O*(b-_)/(w-1),B[O]=p(T),S[O]=h(T);for(O=0;O<y;O++)for(I=0;I<w;I++)L[N++]=o.x*q[O]*S[I],L[N++]=o.y*q[O]*B[I],L[N++]=o.z*U[O];if(g)for(O=0;O<y;O++)for(I=0;I<w;I++)L[N++]=a.x*q[O]*S[I],L[N++]=a.y*q[O]*B[I],L[N++]=a.z*U[O];for(N=0,O=0;O<x*A;O++){var F=O*y;for(I=0;I<y-1;I++)G[N++]=F+I,G[N++]=F+I+1}var W=x*y*A;for(O=0;O<w;O++)for(I=0;I<y-1;I++)G[N++]=W+O+I*w,G[N++]=W+O+(I+1)*w;if(g)for(W=x*y*A+w*y,O=0;O<w;O++)for(I=0;I<y-1;I++)G[N++]=W+O+I*w,G[N++]=W+O+(I+1)*w;if(g){var Y=x*y*A,J=Y+y*w;if(M)for(O=0;O<w;O++)G[N++]=Y+O,G[N++]=J+O;if(z)for(Y+=y*w-w,J+=y*w-w,O=0;O<w;O++)G[N++]=Y+O,G[N++]=J+O}var j=new u.a({position:new m.o({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:L})});if(r.e(t._offsetAttribute)){var H=L.length,K=new Uint8Array(H/3),Q=t._offsetAttribute===f.z.NONE?0:1;i.d(K,Q),j.applyOffset=new m.o({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:K})}return new m.I({attributes:j,indices:G,primitiveType:l._0x29ba75.LINES,boundingSphere:e.i.fromEllipsoid(C),offsetAttribute:t._offsetAttribute})}}},t.x=b}));
|