拖旺项目:聊城公交辅助决策系统
zhaoxing
2022-05-08 d5859b70023f40c195c58f81d3abcd14980cb722
1
define(["./GeometryOffsetAttribute-369d5efa","./Transforms-4a1d2c0e","./Matrix2-f0fc6cd3","./RuntimeError-8f3d96ee","./ComponentDatatype-5f63ec93","./CylinderGeometryLibrary-6799e174","./when-229515d6","./GeometryAttribute-4b6dfc85","./GeometryAttributes-b253752a","./IndexDatatype-c2b69fc2","./combine-6d9c3903","./WebGLConstants-f63312fc"],(function(t,e,i,n,o,r,a,s,u,f,c,d){"use strict";const l=new i.Cartesian2;function m(t){const e=(t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,n=t.bottomRadius,o=a.defaultValue(t.slices,128),r=Math.max(a.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=n,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}m.packedLength=6,m.pack=function(t,e,i){return i=a.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=a.defaultValue(t._offsetAttribute,-1),e};const b={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return m.unpack=function(t,e,i){e=a.defaultValue(e,0);const n=t[e++],o=t[e++],r=t[e++],s=t[e++],u=t[e++],f=t[e];return a.defined(i)?(i._length=n,i._topRadius=o,i._bottomRadius=r,i._slices=s,i._numberOfVerticalLines=u,i._offsetAttribute=-1===f?void 0:f,i):(b.length=n,b.topRadius=o,b.bottomRadius=r,b.slices=s,b.numberOfVerticalLines=u,b.offsetAttribute=-1===f?void 0:f,new m(b))},m.createGeometry=function(n){let c=n._length;const d=n._topRadius,m=n._bottomRadius,b=n._slices,p=n._numberOfVerticalLines;if(c<=0||d<0||m<0||0===d&&0===m)return;const y=2*b,_=r.CylinderGeometryLibrary.computePositions(c,d,m,b,!1);let h,A=2*b;if(p>0){const t=Math.min(p,b);h=Math.round(b/t),A+=t}const R=f.IndexDatatype.createTypedArray(y,2*A);let G,O=0;for(G=0;G<b-1;G++)R[O++]=G,R[O++]=G+1,R[O++]=G+b,R[O++]=G+1+b;if(R[O++]=b-1,R[O++]=0,R[O++]=b+b-1,R[O++]=b,p>0)for(G=0;G<b;G+=h)R[O++]=G,R[O++]=G+b;const V=new u.GeometryAttributes;V.position=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:_}),l.x=.5*c,l.y=Math.max(m,d);const L=new e.BoundingSphere(i.Cartesian3.ZERO,i.Cartesian2.magnitude(l));if(a.defined(n._offsetAttribute)){c=_.length;const e=new Uint8Array(c/3),i=n._offsetAttribute===t.GeometryOffsetAttribute.NONE?0:1;t.arrayFill(e,i),V.applyOffset=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return new s.Geometry({attributes:V,indices:R,primitiveType:s.PrimitiveType.LINES,boundingSphere:L,offsetAttribute:n._offsetAttribute})},function(t,e){return a.defined(e)&&(t=m.unpack(t,e)),m.createGeometry(t)}}));